Skip to content

Commit

Permalink
🐑 Clone mdast for html demo (#285)
Browse files Browse the repository at this point in the history
  • Loading branch information
rowanc1 authored Nov 23, 2023
1 parent b849403 commit d21e6f2
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
12 changes: 12 additions & 0 deletions .changeset/short-mugs-smell.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
'myst-to-react': patch
'myst-demo': patch
'@myst-theme/providers': patch
'@myst-theme/jupyter': patch
'@myst-theme/common': patch
'@myst-theme/article': patch
'@myst-theme/site': patch
'@myst-theme/book': patch
---

Updates to myst and bug fix for myst-demo (clone for html output).
4 changes: 2 additions & 2 deletions packages/myst-demo/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ async function parse(
// Also run some of the transforms, like the links
const mdastPre = JSON.parse(JSON.stringify(mdast));
visit(mdastPre, (n) => delete n.position);
unified().use(linksPlugin, { transformers: linkTransforms }).runSync(mdast);
const htmlString = mystToHtml(mdast);
const htmlString = mystToHtml(JSON.parse(JSON.stringify(mdast)));
const references = {
cite: { order: [], data: {} },
footnotes: {},
Expand Down Expand Up @@ -141,6 +140,7 @@ async function parse(
.use(resolveReferencesPlugin, { state })
.use(keysPlugin)
.runSync(mdast as any, file);

const mdastPost = JSON.parse(JSON.stringify(mdast));
visit(mdastPost, (n) => {
delete n.position;
Expand Down

0 comments on commit d21e6f2

Please sign in to comment.