;
19 | useSpacing: boolean;
20 | useMargins: boolean;
21 | useRawFormat: boolean;
22 | static viewName = "DepictionMarkdownView";
23 |
24 | constructor(dictionary: any) {
25 | super(dictionary);
26 | let md = guardIfNotType(dictionary["markdown"], "string");
27 | this.useMargins = defaultIfNotType(dictionary["useMargins"], "boolean", true);
28 | this.useSpacing = defaultIfNotType(dictionary["useSpacing"], "boolean", true);
29 | this.useRawFormat = defaultIfNotType(dictionary["useRawFormat"], "boolean", false);
30 | if (this.useRawFormat) {
31 | this.markdown = callMarked(md, { gfm: false }).then(async (rendered) => {
32 | let didWarnXSS = false;
33 | let xssWarn = `[Warning: This depiction may be trying to maliciously run code in your browser.]
`;
34 | rendered = rendered.replace(
35 | /
/gi,
36 | await renderElementString(await makeView(new DepictionSeparatorView(undefined)))
37 | );
38 | if (
39 | rendered.toLowerCase().indexOf("") !== -1
41 | ) {
42 | rendered = rendered
43 | .replace(/