Comments (5)
Guess it doesn't matter too much either way. I've merged the PR.
from markdown.
I've gone ahead and made a PR (since this is a dead simple change) if you're happy with this @marijnh.
from markdown.
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.
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.
Thanks!
from markdown.
Related Issues (20)
- Table extension does not follow GFM spec (cannot interrupt a paragraph) HOT 5
- Proposed exports HOT 4
- Some reference documentation is not updated HOT 1
- The `line`-parameter in `BlockParser` `parse()`-methods should not be a side-effect HOT 2
- Unable to run "prepare" script HOT 3
- More extensions: Insert and Mark HOT 3
- Table parser does not create a TableCell element that is empty or only comprised of spaces/tabs. HOT 8
- Is removing language features possible? HOT 1
- heads up: swc fails to minify the package correctly HOT 3
- Code block breaks when backticks are inside a property HOT 1
- Autolink fails for URLs with >3 parts in the domain HOT 2
- Table folding not work HOT 1
- Autolinks and regular link URLs are both parsed as "URL" nodes
- Spec deviation with angle-bracketed link destination followed by title
- Add alerts to GFM HOT 1
- MDX support HOT 1
- Autolink ending with '/' in an image HOT 1
- Custom tags for table elements HOT 5
- Styling Codeblocks (Fenced Code) HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from markdown.