GithubHelp home page GithubHelp logo

Comments (5)

marijnh avatar marijnh commented on June 23, 2024 1

Guess it doesn't matter too much either way. I've merged the PR.

from markdown.

acnebs avatar acnebs commented on June 23, 2024

I've gone ahead and made a PR (since this is a dead simple change) if you're happy with this @marijnh.

from markdown.

marijnh avatar marijnh commented on June 23, 2024

I'm wondering if we might also want to parse lines with just - [ ] as tasks lists (not following the spec) in order to make this less confusing to people typing this in an editor. (This package is more about editor tooling than about fully correct Markdown parsing.)

from markdown.

acnebs avatar acnebs commented on June 23, 2024

Yeah, I was thinking about that as well, and was a bit conflicted. On the one hand if the user actually follows through, it is less jarring for them if the task list is marked as such as soon as they type the closing bracket. However, it does seem desirable to highlight things according to the spec because otherwise it is slightly misleading. A user types - [ ], it is highlighted by lezer as a task list, but then when they actually throw that into basically any markdown renderer with GFM support, it will not be rendered as such.

That being said, for my use-case in particular, I think the best solution is what I've done in the PR, as with an "auto-continue list functionality" (or any sort of "we start the list for you" functionality) a space can be automatically included at the end (- [ ] ), and that gets highlighted even though there is technically no content afterwards yet. This is less jarring than if you required content after the whitespace. But we still don't want to display it as valid without the whitespace, because we want users to know that it is wrong while they are editing.

from markdown.

acnebs avatar acnebs commented on June 23, 2024

Thanks!

from 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.