@minamorl/markdown-next 2.1.1 → 2.2.0

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/lib/src/parser.js CHANGED
@@ -118,10 +118,11 @@ class Parser {
118
118
  return mapper(tag)(join(children));
119
119
  });
120
120
  });
121
- // Math expressions (KaTeX-compatible)
121
+ // Math expressions - output raw $...$ for MathJax to process
122
122
  // Inline math: $...$
123
123
  const mathInline = P.seqMap(P.string("$").notFollowedBy(P.string("$")), P.regexp(/[^\$\r\n]+/), P.string("$"), (_1, content, _3) => {
124
- return mapper("span", { class: "math math-inline", "data-math": content })(content);
124
+ // Output raw $...$ for MathJax auto-detection
125
+ return "$" + content + "$";
125
126
  });
126
127
  const inline = P.alt(pluginInline, aozoraRuby, anchor, img, em, strong, code, mathInline, htmlSelfClosing, htmlElement, P.regexp(/[^\r\n<=-\[\]\*\`\@|\$]+/), P.regexp(/./));
127
128
  // Table cell content - supports inline elements
@@ -362,7 +363,8 @@ class Parser {
362
363
  // Content can include anything except $$ (including single $, newlines, etc.)
363
364
  const mathBlockContent = P.regexp(/[\s\S]*?(?=\$\$)/);
364
365
  const mathBlock = P.seqMap(P.regexp(/^\$\$/), mathBlockContent, P.string("$$"), P.alt(linebreak, P.eof), (_1, content, _3, _4) => {
365
- return mapper("div", { class: "math math-display", "data-math": content.trim() })(content.trim());
366
+ // Output raw $$...$$ for MathJax auto-detection
367
+ return "$$" + content.trim() + "$$";
366
368
  });
367
369
  const block = P.alt(P.regexp(/\s+/).result(""), pluginBlock, h1Special, h2Special, h6, h5, h4, h3, h2, h1, table, codeBlock, mathBlock, lists, blockquote, paragraph, linebreak.result(""));
368
370
  this.acceptables = P.alt(block).many().map(join);
package/package.json CHANGED
@@ -37,5 +37,5 @@
37
37
  "url": "https://github.com/minamorl/markdown-next/issues"
38
38
  },
39
39
  "homepage": "https://github.com/minamorl/markdown-next#readme",
40
- "version": "2.1.1"
40
+ "version": "2.2.0"
41
41
  }