Giter VIP home page Giter VIP logo

Comments (3)

wooorm avatar wooorm commented on May 27, 2024

Thanks for raising this issue.
I am working on a port of micromark in another language, which improves a couple of architectural things, likely also including this problem.
It's going to take a bit but I am planning to port those back.
In the meantime, perhaps you can find out how to fix this here now.

from micromark.

github-actions avatar github-actions commented on May 27, 2024

Hi! This was marked as ready to be worked on! Note that while this is ready to be worked on, nothing is said about priority: it may take a while for this to be solved.

Is this something you can and want to work on?

Team: please use the area/* (to describe the scope of the change), platform/* (if this is related to a specific one), and semver/* and type/* labels to annotate this. If this is first-timers friendly, add good first issue and if this could use help, add help wanted.

from micromark.

sisp avatar sisp commented on May 27, 2024

I think there are two possible places where this problem could be fixed:

  1. micromark/dev/lib/compile.js::prepareList: When compiling to basic HTML, the events related to a list are preprocessed such that the items of a list without blank lines between items are compiled as <li>...</li> and items of a list with blank lines in at least one item are compiled as <li><p>...</p></li> (tight vs. loose lists). This preprocessing logic could be extended to ignore trailing blank lines which are part of the tokenized list.
  2. micromark-core-commonmark/dev/lib/list.js::tokenizeListContinuation: The list continuation tokenizer could be modified to not only check whether the current line is a blank line but rather keep checking subsequent lines until a non-blank line is found that terminates the list and abort then, so that the blank lines (including non-empty blank lines, which are treated as list item prefixes + line endings) are excluded in the last list item.

I tend to prefer option 2, but I'm not sure whether that's easily done with a document parser as lines are parsed independently and content is parsed implicitly. Any comments and/or suggestions?

from micromark.

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.