Comments (3)
👋 Thanks for the report! It looks like the table extension doesn't get to fire before the ordered list parser, causing this strange result.
comrak is pretty much a straight copy of the GitHub cmark-gfm code, which is why they render the same, so I guess technically this is an issue with cmark-gfm. I'll try to fix this first in github/cmark, and then copy the fix across here.
from comrak.
(Note that, as a work around, you can include a leading |
)
from comrak.
I've reviewed the code and the spec a bit, and it looks like this probably isn't something we can "fix" without actually altering the spec (which I'm loathe to do). See here:
The table is broken at the first empty line, or beginning of another block-level structure:
| abc | def | | --- | --- | | bar | baz | > bar
abc def bar baz bar
In order to preserve logical parsing precedence rules, it'd be pretty difficult to have that last line interpreted as part of the table if and only if there was a pipe (|
) character located somewhere in it.
pulldown-cmark's parsing strategy for tables differs quite a bit, which is why this "works" there, but without breaking examples like the above (and/or big hacks), I don't think we'll be able to achieve this in GFM.
So, I think the solution will be to prefix the table with pipes:
| Number | Tag | Description
| -------|-----|---------
| 1. | CC | Coordinating conjunction
| 2. | CD | Cardinal number
| 3. | DT | Determiner
| 4. | EX | Existential there
Producing:
Number | Tag | Description |
---|---|---|
1. | CC | Coordinating conjunction |
2. | CD | Cardinal number |
3. | DT | Determiner |
4. | EX | Existential there |
from comrak.
Related Issues (20)
- Should parsing a markdown file and rendering it back to markdown preserve the state? HOT 1
- Benchmark PR job failing due to permissions HOT 2
- About shortcodes, maybe a bug? HOT 1
- kivikakk/cmark-gfm doesn't exist HOT 1
- Construct an AST programmatically in 0.20 HOT 5
- [GFM] Alerts HOT 1
- How is the fuzzing run / fuzz testing as part of CI HOT 3
- Lists not exitable HOT 3
- Width options usage ? HOT 2
- nested lists not rendering properly HOT 1
- Adding Node.traverse() examples and/or documentation. HOT 9
- Invalid rendering of a list followed by another block HOT 9
- Rendering of hard line breaks HOT 2
- Can `comrak` format directories recursively? HOT 4
- Incorrect sourcepos for Setext headings HOT 1
- Change autolink to allow more protocols, same as normal markdown links HOT 5
- Autolink edge cases HOT 7
- Autolink edge case: underscores in url
- [feature request] Make copy-paste preserve markdown on generated HTML HOT 7
- Proposal: Discord-flavored Markdown 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 comrak.