Coder Social home page Coder Social logo

Comments (16)

quantizor avatar quantizor commented on May 28, 2024 1

Thanks, I'll take a look in the next few days

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024 1

from markdown-to-jsx.

michaelryancaputo avatar michaelryancaputo commented on May 28, 2024 1

Just for reference, I posted some use cases here:
This is an example using 6.4.1 - https://stackblitz.com/edit/react-qugqd6
This is an example using 6.6.1 - https://stackblitz.com/edit/react-6nelfr

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024

Just a sidenote: entering "#a" crashes the compiler.

I'm not seeing that behavior btw - if you pop it into the demo site it works as expected.

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

I'm not seeing that behavior btw - if you pop it into the demo site it works as expected.

Did you include the quotation marks and the span? On my machine it crashes the demo site.

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024

Yup, it didn't crash for me.

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024

It's possible you might be viewing a cached, older version of the site?

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

It is for sure the most recent version offered by the server. But since it doesn't crash my local installation, it can only be an issue of outdated files.

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

Interestingly if I run https://runkit.com/stephtr/runkit-npm-markdown-to-jsx it runs indefinitely. I will try to debug it if I have some time left.
(markdownToJsx.compiler('"<span>#</span>"'); also gets stuck on my local node installation."

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024

A fix is pushed in v6.6.1, let me know how it goes!

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

6.6.1 fixes the crash, however the nested HTML tags still don't render correctly. Additionally, as far as I know, markdown inside HTML inside markdown is only allowed with inline elements, so when given <div>#a</div>, markdown-to-jsx should output just <div>#a</div>.

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

Actually there are:

Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style *emphasis * inside an HTML block.
[…]
Unlike block-level HTML tags, Markdown syntax is processed within span-level tags.

Otherwise it wouldn't be possible to start with an hashtag within an element without escaping it. (For example, I would like to display the hex color code within a colored div.)

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

Usually when mention such issues I try to help with a PR, but unfortunately at the moment I'm too busy with my other projects.

One approach would be to first convert the whole Markdown code to HTML using an existing parser (which, in contrast to simple-markdown, is able to handle HTML), which would obviate correctly implementing all rules.

from markdown-to-jsx.

quantizor avatar quantizor commented on May 28, 2024

from markdown-to-jsx.

stephtr avatar stephtr commented on May 28, 2024

Ah, I just saw #159. However before keeping the actual state (messed up parsing of HTML) I would revert #156.

from markdown-to-jsx.

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.