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
package/dist/markdown2typst.js
CHANGED
|
@@ -13454,8 +13454,12 @@ function remarkFixAdjacentMath() {
|
|
|
13454
13454
|
// src/parser.ts
|
|
13455
13455
|
function parseMarkdown(markdown, onError) {
|
|
13456
13456
|
try {
|
|
13457
|
+
const normalizedMarkdown = markdown.replace(
|
|
13458
|
+
/([^\n])\n(\$\$)/g,
|
|
13459
|
+
"$1\n\n$2"
|
|
13460
|
+
);
|
|
13457
13461
|
const processor = unified().use(remarkParse).use(remarkFrontmatter, ["yaml"]).use(remarkGfm, { singleTilde: false }).use(remarkMath).use(remarkFixAdjacentMath);
|
|
13458
|
-
const parsedTree = processor.parse(
|
|
13462
|
+
const parsedTree = processor.parse(normalizedMarkdown);
|
|
13459
13463
|
const tree = processor.runSync(parsedTree);
|
|
13460
13464
|
return tree;
|
|
13461
13465
|
} catch (error) {
|