mathpix-markdown-it 2.0.37 → 2.0.38
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/doc/changelog.md +16 -0
- package/es5/bundle.js +1 -1
- package/es5/index.js +1 -1
- package/lib/markdown/md-inline-rule/diagbox-inline.js +46 -46
- package/lib/markdown/md-inline-rule/diagbox-inline.js.map +1 -1
- package/lib/markdown/md-inline-rule/mmd-icon.js +42 -46
- package/lib/markdown/md-inline-rule/mmd-icon.js.map +1 -1
- package/package.json +1 -1
- package/pr-specs/2026-03-fix-silent-mode-state-pos.md +103 -0
package/doc/changelog.md
CHANGED
|
@@ -1,5 +1,21 @@
|
|
|
1
1
|
# March 2026
|
|
2
2
|
|
|
3
|
+
## [2.0.38] - Fix infinite loop in `inlineMmdIcon` and `inlineDiagbox` silent mode
|
|
4
|
+
|
|
5
|
+
- Bug Fix:
|
|
6
|
+
- Fixed page freeze when `\icon{...}` or `\diagbox{...}` appeared inside link labels (e.g. `[\icon{unknown}]`). The inline rules returned `true` in silent mode without advancing `state.pos`, causing an infinite loop in markdown-it's `parseLinkLabel` → `skipToken`.
|
|
7
|
+
|
|
8
|
+
- Refactoring:
|
|
9
|
+
- `inlineMmdIcon` and `inlineDiagbox` refactored to follow the `if (!silent) { ... } state.pos = endPos; return true;` pattern used by all other inline rules.
|
|
10
|
+
- `mmd-icon.ts`: extracted `endPos` constant, eliminated 6 duplicated position assignments.
|
|
11
|
+
- `diagbox-inline.ts`: moved `extractNextBraceContent` before the silent check so `endIndex` is available in both modes.
|
|
12
|
+
|
|
13
|
+
- Tests:
|
|
14
|
+
- Added 4 test cases for icon and diagbox inside link labels and bare brackets.
|
|
15
|
+
|
|
16
|
+
- Docs:
|
|
17
|
+
- Added implementation details in `pr-specs/2026-03-fix-silent-mode-state-pos.md`.
|
|
18
|
+
|
|
3
19
|
## [2.0.37] - CSS scoping and style module cleanup
|
|
4
20
|
|
|
5
21
|
- CSS Scoping:
|