MCPcopy
hub / github.com/plotly/dash / constructor

Method constructor

components/dash-table/src/dash-table/utils/Markdown.ts:9–29  ·  view source on GitHub ↗
(private readonly options: IMarkdownOptions)

Source from the content-addressed store, hash-verified

7 private readonly md: Remarkable;
8
9 constructor(private readonly options: IMarkdownOptions) {
10 this.md = new Remarkable({
11 highlight: (str: string, lang: string) => {
12 if (Markdown.hljs) {
13 if (lang && Markdown.hljs.getLanguage(lang)) {
14 try {
15 return Markdown.hljs.highlight(lang, str).value;
16 } catch (err) {}
17 }
18
19 try {
20 return Markdown.hljs.highlightAuto(str).value;
21 } catch (err) {}
22 } else {
23 Markdown.loadhljs();
24 }
25 return '';
26 },
27 ...objPropsToCamel(this.options)
28 });
29 }
30
31 public render = (value: string) => this.md.render(value);
32

Callers

nothing calls this directly

Calls 3

objPropsToCamelFunction · 0.85
highlightMethod · 0.80
loadhljsMethod · 0.80

Tested by

no test coverage detected