markdown2typst 0.1.8 → 0.1.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/markdown2typst.browser.js +5 -1
- package/dist/markdown2typst.browser.js.map +2 -2
- package/dist/markdown2typst.browser.min.js +24 -22
- package/dist/markdown2typst.js +5 -1
- package/dist/markdown2typst.js.map +2 -2
- package/dist/markdown2typst.min.js +26 -24
- package/package.json +1 -1
- package/src/parser.ts +7 -1
|
@@ -13466,8 +13466,12 @@ var markdown2typstLib = (() => {
|
|
|
13466
13466
|
// src/parser.ts
|
|
13467
13467
|
function parseMarkdown(markdown, onError) {
|
|
13468
13468
|
try {
|
|
13469
|
+
const normalizedMarkdown = markdown.replace(
|
|
13470
|
+
/([^\n])\n(\$\$)/g,
|
|
13471
|
+
"$1\n\n$2"
|
|
13472
|
+
);
|
|
13469
13473
|
const processor = unified().use(remarkParse).use(remarkFrontmatter, ["yaml"]).use(remarkGfm, { singleTilde: false }).use(remarkMath).use(remarkFixAdjacentMath);
|
|
13470
|
-
const parsedTree = processor.parse(
|
|
13474
|
+
const parsedTree = processor.parse(normalizedMarkdown);
|
|
13471
13475
|
const tree = processor.runSync(parsedTree);
|
|
13472
13476
|
return tree;
|
|
13473
13477
|
} catch (error) {
|