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.
@@ -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(markdown);
13462
+ const parsedTree = processor.parse(normalizedMarkdown);
13459
13463
  const tree = processor.runSync(parsedTree);
13460
13464
  return tree;
13461
13465
  } catch (error) {