Skip to content
Snippets Groups Projects
Forked from TO / cf-online-ui
100 commits behind the upstream repository.
markdown.js 440 B
import Showdown from "showdown";
import xss from "xss";

const xssFilter = (converter) => [
  {
    type: "output",
    filter: (text) => xss(text),
  },
];

export const markdownConverter = new Showdown.Converter({
  tables: true,
  simplifiedAutoLink: true,
  strikethrough: true,
  tasklists: false,
  omitExtraWLInCodeBlocks: true,
  noHeaderId: true,
  headerLevelStart: 2,
  openLinksInNewWindow: true,
  extensions: [xssFilter],
});