-
-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Parsing fails when disabling construct codeIndented
(using micromark-extension-mdx-md
)
#1
Comments
Yep, probably the same bug. To solve this, I think you could do something like this: https://github.com/micromark/micromark/blob/ce3593ae2f5ff549d9d4445193d950b9a9e95189/packages/micromark-core-commonmark/dev/lib/code-fenced.js#L37-L40. That is: |
Isn't In Unfortunately, I am not familiar enough with the internals of micromark to write a PR. |
Ah, you are right that they both already do the first step: a). Fenced code parses arbitrary whitespace: https://github.com/micromark/micromark/blob/ce3593ae2f5ff549d9d4445193d950b9a9e95189/packages/micromark-core-commonmark/dev/lib/code-fenced.js#L209-L211. Math (flow) does not: micromark-extension-math/dev/lib/math-flow.js Lines 294 to 299 in c44bc3a
The results you see are different because tables and math/code are different. |
The problem occurs only when construct codeIndented is disabled, as is the case with micromark-extension-mdx-md.
Initial checklist
Affected packages and versions
[email protected]
Link to runnable example
https://codepen.io/tumidi/pen/rNqxMjm
Steps to reproduce
The CodePen shows that parsing display math fails when nested in two MDX elements and using indent of four spaces.
Might be related or similar to micromark/micromark-extension-gfm-table#10.
Expected behavior
Display math should be parsed correctly.
Actual behavior
Parsing fails with
Expected a closing tag for <div>
.Runtime
Other (please specify in steps to reproduce)
Package manager
Other (please specify in steps to reproduce)
OS
Linux
Build and bundle tools
Other (please specify in steps to reproduce)
The text was updated successfully, but these errors were encountered: