Comments (11)
Apologies for not providing a runnable example, but I spent more time trying (and failing) to get codesandbox to do something useful than I did on the rest of the report. 😅
from remark.
Thanks @benblank!
Here is the repro in a sandbox https://stackblitz.com/edit/node-mneiet?file=index.js
I'm seeing the same behavior you describe when running remark 15.0.1
Checking the four examples in CommonMark Dingus
- https://spec.commonmark.org/dingus/?text=The%20preceeding%20paragraph.%0A%0A1.%20one%0A4.%20two
- https://spec.commonmark.org/dingus/?text=The%20preceeding%20paragraph.%0A%0A01.%20one%0A02.%20two
- https://spec.commonmark.org/dingus/?text=The%20preceeding%20paragraph.%0A1.%20one%0A2.%20two
- https://spec.commonmark.org/dingus/?text=The%20preceeding%20paragraph.%0A01.%20one%0A02.%20two
It does indeed appear all four should produce a list
Tracing further.
I suspect the issue is down one level in micromark
, I'm able to replicate the issue without having the AST generated https://stackblitz.com/edit/node-1ygk3h?file=index.js
from remark.
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 remark.
I suspect the issue is down one level in micromark, I'm able to replicate the issue without having the AST generated
Ah! Dang. I'd traced it this far down from Prettier and thought I'd gotten to the bottom of it. 🙂
Thanks for all the helpful links!
from remark.
I do think the spec is unclear for this:
In order to solve of unwanted lists in paragraphs with hard-wrapped numerals, we allow only lists starting with `1` to interrupt paragraphs. Thus,~
(right above example 304).
As in, I followed those words here.
I think that the current behavior is in line with the reasoning there. Natural language phrases might include 1.
, but 2.
or 01.
are more unlikely.
from remark.
If you care strongly about this, could you perhaps open an issue with commonmark/commonmark-spec
to check what the idea is?
from remark.
Actually, I missed that when I was reading through the spec. I'm not sure I 100% agree with the reasoning behind it, but those reasons do at least appear to be pretty clear.
I may indeed open up an issue with regards to the phasing, though; I feel the section you quoted would be improved by calling out that it's only referring to ordered lists and to the markers 1.
and 1)
(not the character 1
), even if there are examples demonstrating both cases. The emphasis on the principle of uniformity also suggests that the exception applies to nested lists as well, but I don't see text or an example calling that out.
I also have to admit to being a bit surprised to see "interrupting, not starting with 1
" called out as not being valid, simply because when I was checking BabelMark, a large number of the parsers (including nine of the twelve marked as specifically targeting CommonMark) considered it valid.
On the one hand, it's a shame to "disagree" with so many other implementations, but the spec is clear as to what the Right Thing is, and it isn't what I was trying to do. I'll go ahead and close the issue.
Thanks for taking the time to look into this!
from remark.
Hi! This was closed. Team: If this was fixed, please add phase/solved
. Otherwise, please add one of the no/*
labels.
from remark.
Hi team! Could you describe why this has been marked as wontfix?
Thanks,
— bb
from remark.
Hi team! I don’t know what’s up as there’s no phase label. Please add one so I know where it’s at.
Thanks,
— bb
from remark.
There’s a wide variety of parser that all do things differently.
CM likes to be ambiguous on all the edge cases. This also comes as a given when it’s mostly a test suite of input/output examples, and not an explanation of an algorithm (such as HTML).
I’d like a more formal spec. But I can see value in this too.
Anyway, feel free to PR to the spec another example of the 01
case. Then I (and others) will go with the one that’s decided for that!
from remark.
Related Issues (20)
- A stringifier option to control escaping HOT 8
- Please consider support for multi-row Headers for Tables HOT 2
- Multiple spaces in list items HOT 4
- Ampersand in link query strings unexpectedly escaped with backslash HOT 5
- remark-parse: `(` in strong block will broke the block HOT 7
- Footnotes do not work within mermaid diagrams HOT 2
- How to display incomplete PHP code outside of a code block HOT 4
- Unified v11 has been released, can remark be updated to support it? HOT 4
- New release with updated dependencies HOT 8
- TypeError: this.getData is not a function HOT 4
- `Compile` not set when used as a unified plugin HOT 4
- Remark plugin is un-escaping content HOT 4
- HTML entity is mangled HOT 4
- Thematic break after image is parsed as an heading level 2 HOT 3
- remark-cli no longer allows using multiple plugins via the `--use` parameter HOT 2
- Underline feature is not working with remark HOT 4
- 🚀 Support Github-style Alerts, Callouts, etc. (Beta) HOT 9
- Module not found: Can't resolve 'devlop' in '/app/node_modules/remark/node_modules/unified/lib' HOT 2
- Incorrect Parsing of Markdown with Special Characters Adjacent to Strong Tags in Non-English Contexts 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 remark.