mirror of
https://github.com/grafana/grafana.git
synced 2024-12-02 05:29:42 -06:00
8541214c9e
* Replace remarkable with marked * Add wrapper and options for marked
21 lines
479 B
TypeScript
21 lines
479 B
TypeScript
import marked, { MarkedOptions } from 'marked';
|
|
|
|
const defaultMarkedOptions: MarkedOptions = {
|
|
renderer: new marked.Renderer(),
|
|
pedantic: false,
|
|
gfm: true,
|
|
tables: true,
|
|
sanitize: true,
|
|
smartLists: true,
|
|
smartypants: false,
|
|
xhtml: false,
|
|
};
|
|
|
|
export function setMarkdownOptions(optionsOverride?: MarkedOptions) {
|
|
marked.setOptions({ ...defaultMarkedOptions, ...optionsOverride });
|
|
}
|
|
|
|
export function renderMarkdown(str: string): string {
|
|
return marked(str);
|
|
}
|