From 2fd6674e60b33139b13944e8b1f4b439b54a90b6 Mon Sep 17 00:00:00 2001 From: Rowan Cockett Date: Mon, 20 Mar 2023 23:56:42 -0600 Subject: [PATCH] =?UTF-8?q?=F0=9F=90=9B=20Fix=20HTML=20rendering=20in=20Ju?= =?UTF-8?q?pyterLab?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/myst.ts | 22 +++++++++++----------- src/renderers.tsx | 4 ++++ 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/myst.ts b/src/myst.ts index 688c027..73e5d4b 100644 --- a/src/myst.ts +++ b/src/myst.ts @@ -12,8 +12,8 @@ import { RRIDTransformer, linksPlugin, ReferenceState, - getFrontmatter, - htmlPlugin + getFrontmatter + // htmlPlugin } from 'myst-transforms'; import { unified } from 'unified'; import { VFile } from 'vfile'; @@ -56,15 +56,15 @@ export function markdownParse(text: string): Root { // This is consistent with the current Jupyter markdown renderer unified() .use(basicTransformationsPlugin) - .use(htmlPlugin, { - htmlHandlers: { - comment(h: any, node: any) { - const result = h(node, 'comment'); - (result as any).value = node.value; - return result; - } - } - }) + // .use(htmlPlugin, { + // htmlHandlers: { + // comment(h: any, node: any) { + // const result = h(node, 'comment'); + // (result as any).value = node.value; + // return result; + // } + // } + // }) .runSync(mdast as any); return mdast as Root; } diff --git a/src/renderers.tsx b/src/renderers.tsx index 62a82a7..9edbcdb 100644 --- a/src/renderers.tsx +++ b/src/renderers.tsx @@ -9,5 +9,9 @@ export const renderers: Record = { mermaid: MermaidNodeRenderer, inlineExpression: (node, children) => { return ; + }, + html: (node, children) => { + // TODO: This needs to be sanitized properly + return ; } };