Coder Social home page Coder Social logo

When there are non space characters after $$ the parser ends up interpreting the whole doc as part of the node (v3) about remark-math HOT 8 CLOSED

remarkjs avatar remarkjs commented on July 17, 2024
When there are non space characters after $$ the parser ends up interpreting the whole doc as part of the node (v3)

from remark-math.

Comments (8)

wooorm avatar wooorm commented on July 17, 2024

This is in line with how fenced code works too. Take this markdown.

# Debug

```
\LaTeX
``` words

more words

Debug

\LaTeX
``` words

more words

So everything after it becomes code.

Why not fix your โ€œclosingโ€ fence?

from remark-math.

wooorm avatar wooorm commented on July 17, 2024

Closing this as itโ€™s intended behavior documented in the changelog: 9b4b3c3

from remark-math.

Stvad avatar Stvad commented on July 17, 2024

I see, this is unfortunate ๐Ÿ™. This has really bad consequences when used with MDX - if you interleave this somewhere within the document - it's gonna consume JSX components/any meta code/etc after till the end of the document =\ . Leading to MDX failing to parse things

from remark-math.

wooorm avatar wooorm commented on July 17, 2024

Please elaborate.

from remark-math.

Stvad avatar Stvad commented on July 17, 2024

I've described my context in mdx-js/mdx#1477 (reply in thread) which I believe you saw.
If a snippet like described in this issue - gets passed in to me as an input and I put it into an MDX document - It's going to corrupt the overall constructed document as it's going to consume the closing tag for it's section and the rest of the document making the parsing and the build fail ๐Ÿ™

from remark-math.

wooorm avatar wooorm commented on July 17, 2024

If a snippet like described in this issue - gets passed in to me as an input and I put it into an MDX document - It's going to corrupt the overall constructed document as it's going to consume the closing tag for it's section and the rest of the document making the parsing and the build fail ๐Ÿ™

Thatโ€™s how things work. If you pass <div></div> to an HTML parser, itโ€™s going to see an element. If you pass console.log(1) to a JavaScript parser, itโ€™s going to see a function call.

This isnโ€™t an issue here (https://xyproblem.info): it has to do with the overall discussion over there

from remark-math.

wooorm avatar wooorm commented on July 17, 2024

whoops ๐Ÿ˜… should be closed I think

from remark-math.

Guyutongxue avatar Guyutongxue commented on July 17, 2024

Very bad design ๐Ÿ‘Ž . Almost every MarkDown extension support inline $$expr$$, both marked, markdown-it, GitHub ...

I'm now migrating some MarkDown-with-math files from markdown-it to remark. Holy **** this behavior just make everything a mess.

from remark-math.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.