Coder Social home page Coder Social logo

bug in lists about prosemirror-markdown HOT 6 CLOSED

williamstein avatar williamstein commented on August 23, 2024 1
bug in lists

from prosemirror-markdown.

Comments (6)

marijnh avatar marijnh commented on August 23, 2024 1

Probably in the link right above my comment.

64f7027

from prosemirror-markdown.

williamstein avatar williamstein commented on August 23, 2024

The same issue occurs with enumerated lists.

from prosemirror-markdown.

marijnh avatar marijnh commented on August 23, 2024

It seems that the markdown parser isn't setting the tight attribute (which stores the difference between the two types of Markdown lists), which is likely the source of this problem. I haven't checked how the current version of markdown-it exposes that, but I guess it shouldn't be too hard to fix that. Want to try creating a patch?

from prosemirror-markdown.

williamstein avatar williamstein commented on August 23, 2024

I haven't checked how the current version of markdown-it exposes that, [...]

I figured out how it does; markdown-it has a "hidden" attribute that the Prosemirror parser is ignoring. See https://markdown-it.github.io/markdown-it/#Token.prototype.hidden for the docs about it. In particular,

"If it's true, ignore this element when rendering. Used for tight lists to hide paragraphs."

Probably they used this approach as a sort of annoying hack to make their codebase easier to maintain...

Want to try creating a patch?

Unsure.

from prosemirror-markdown.

marijnh avatar marijnh commented on August 23, 2024

Attached patch seems to fix this.

from prosemirror-markdown.

stephane-klein avatar stephane-klein commented on August 23, 2024

Attached patch seems to fix this.

@marijnh where is this patch? 🤔.

from prosemirror-markdown.

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.