redbug312 / markdown-it-multimd-table

Multimarkdown table syntax plugin for markdown-it markdown parser
MIT License
144 stars 37 forks source link

Multiline in table header #69

Open Yankie opened 1 month ago

Yankie commented 1 month ago

Hello! It seems that in case of multiline header your plug-in somehow miss to add thead_close and thus it crash markdown-it-attrs. But in case multiline on tbody everything is ok.

| Col | Col | \
| 1 | 2 |
| ---: | :---|
|1|2| \
|3|4|
| ^^ |6|

{.dataTable}

I tried to run into code but stucked in somewhere here https://github.com/redbug312/markdown-it-multimd-table/blob/3477cd3c46ddfecb534189e089192fad06e390a7/index.js#L370

Thanks for a great work and useful plugin. :)

redbug312 commented 1 month ago

I missed marking the first line because the trToken refers to the last line and is dropped. As a result, the multiline row isn't detected as the last row in the table header.

https://github.com/redbug312/markdown-it-multimd-table/blob/3477cd3c46ddfecb534189e089192fad06e390a7/index.js#L212

Thank you for the report. I'll fix this in the next release.