How to use the @ember/string.htmlSafe function in @ember/string

To help you get started, we’ve selected a few @ember/string examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github GeenPeil / teken / frontend / geenpeil-ember / app / components / string-display.js View on Github external
if(display) {
      var valueParts = [];
      var parts = display.split(' ');
      var endIndex = 0;
      var startIndex = 0;
      for(var i=0;i
github Deveo / ember-emojione / addon / services / emoji.js View on Github external
return !emojiDefs[`${id}_tone${anotherTone}`];
        });

    return A(emoji);
  });
}

export default Service.extend({
  emojiDefs,

  categories: A([
    O({id: "people",   name: "Smileys & People", icon: htmlSafe(":grinning:")}),
    O({id: "nature",   name: "Animals & Nature", icon: htmlSafe(":deciduous_tree:")}),
    O({id: "food",     name: "Food & Drink",     icon: htmlSafe(":pizza:")}),
    O({id: "activity", name: "Activity",         icon: htmlSafe(":cartwheel:")}),
    O({id: "travel",   name: "Travel & Places",  icon: htmlSafe(":ship:")}),
    O({id: "objects",  name: "Objects",          icon: htmlSafe(":hammer:")}),
    O({id: "symbols",  name: "Symbols",          icon: htmlSafe(":heart:")}),
    O({id: "flags",    name: "Flags",            icon: htmlSafe(":flag_aq:")}),
    // "regional",
    // "modifier",
  ]),

  emojiCategoryIds: EMOJI_CATEGORIES_ARRAY,
  emojiToneIds: EMOJI_TONES_ARRAY,

  _currentSkinTone: 'default',

  currentSkinTone: computed('_currentSkinTone', {
    get() {
      return this.get('_currentSkinTone');
    },
github adopted-ember-addons / ember-impagination / tests / dummy / app / helpers / color-block.js View on Github external
export function colorBlock(color) {
  return htmlSafe(`background-color: ${color}; width: 600px; height: 70px`);
}
github miragejs / ember-cli-mirage / tests / dummy / app / models / comment.js View on Github external
htmlBody: computed('body', function() {
    return htmlSafe(compileMarkdown(this.body));
  })
github travis-ci / travis-web / app / helpers / commit-link.js View on Github external
compute([vcsType, slug, commitSha]) {
    if (!commitSha) {
      return '';
    }

    const commit = escape(formatCommit(commitSha));

    if (!slug) {
      return commit;
    }

    const [owner, repo] = slug.split('/');
    const commitUrl = this.externalLinks.commitUrl(vcsType, { owner, repo, commit });
    const url = escape(commitUrl);
    const string = `<a href="${url}" class="github-link only-on-hover">${commit}</a>`;
    return new htmlSafe(string);
  }
});
github Fabriquartz / ember-railio-grid / addon / components / data-col.js View on Github external
if (typeof style[property] === 'boolean') {
        style[property] = style[property] ? property : null;
      }

      let value = style[property];
      let stylingProperty = STYLING_PROPERTIES[property];

      if (value && stylingProperty) {
        let key    = stylingProperty.key || dasherize(property);
        let suffix = stylingProperty.suffix || '';

        styles.push(`${key}: ${value}${suffix};`);
      }
    }

    return htmlSafe(styles.join(' '));
  }),
github ilios / frontend / app / components / visualizer-session-type-vocabularies.js View on Github external
async getTooltipData(obj) {
    const isIcon = this.isIcon;
    if (isIcon || isEmpty(obj) || obj.empty) {
      return '';
    }
    const { meta } = obj;

    const vocabularyTitle = meta.vocabulary.get('title');
    const title = htmlSafe(vocabularyTitle);

    return {
      title,
      content: title
    };
  },
github ilios / frontend / app / components / programyear-objective-list-item-expanded.js View on Github external
return objectiveObjects.reduce((set, obj) => {
      let existing = set.findBy('id', obj.courseId);
      if (!existing) {
        let title = obj.courseTitle;
        if (obj.courseExternalId) {
          title += ` (${obj.courseExternalId})`;
        }
        existing = {
          id: obj.courseId,
          title,
          objectives: []
        };
        set.pushObject(existing);
      }
      existing.objectives.pushObject({
        title: htmlSafe(obj.title)
      });
      return set;
    }, []);
  }),
github rancher / ui / lib / alert / addon / components / alert / form-comparison-row / component.js View on Github external
verbStyles: computed('model._targetType', function() {
    const targetType = get(this, 'model._targetType');
    const arr = ['pod', 'workload', 'workloadSelector', 'node', 'nodeSelector']

    let out = '';

    if (arr.includes(targetType)) {
      out = `padding-top: 6px;`;
    }

    return htmlSafe(out);
  }),
github smile-io / ember-polaris / addon / components / polaris-text-field / resizer.js View on Github external
contentsForMinimumLines: computed('minimumLines', function() {
      let minimumLines = this.get('minimumLines');
      let content = '';

      for (let line = 0; line &lt; minimumLines; line++) {
        content = `${content}<br>`;
      }

      return htmlSafe(content);
    }).readOnly(),