import marked from 'marked';

// TODO: Ensure security
const renderer = new marked.Renderer();
renderer.link = (href, title, text) =>
  `<a target="_blank" href="${href}" title="${title}">${text}</a>`;

function renderMarkdown(markdown) {
  return marked(markdown, { renderer });
}

export { renderMarkdown };

import marked from 'marked';

const renderer = new marked.Renderer();
renderer.link = (href, title, text) =>
  `<a target="_blank" href="${href}" title="${title}">${text}</a>`;

function renderMarkdown(markdown) {
  return marked(markdown, { renderer, sanitize: true });
}

export { renderMarkdown };

Enable sanatize html output of marked
Enable sanatize html output of marked
