How to use the ember-cli-addon-docs/utils/compile-markdown.highlightCode function in ember-cli-addon-docs

To help you get started, we’ve selected a few ember-cli-addon-docs 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 ember-animation / ember-animated / tests / dummy / app / pods / index / utils / animated-code-diff / component.js View on Github external
function highlightLineObjects(lineObjects, language) {
  let code = lineObjects.map(lineObject => lineObject.text).join('\n');
  let highlightedCode = highlightCode(code, language);

  return highlightedCode.split('\n').map((text, index) => ({
    id: lineObjects[index].id,
    highlighted: lineObjects[index].highlighted,
    // htmlSafe is justified here because we generated the highlighting markup
    // ourself in highlightCode
    text: htmlSafe(text === "" ? "\n" : text),
  }));
}
github ember-animation / ember-animated / tests / dummy / app / pods / index / controller.js View on Github external
function highlightLineObjects(lineObjects, language) {
  let code = lineObjects.map(lineObject => lineObject.text).join('\n');
  let highlightedCode = highlightCode(code, language);

  return highlightedCode.split('\n').map((text, index) => ({
    id: lineObjects[index].id,
    highlighted: lineObjects[index].highlighted,
    text: text === "" ? "\n" : text,
  }));
}