MichaelHatherly / CommonMark.jl

A CommonMark-compliant Markdown parser for Julia.
Other
87 stars 11 forks source link

Table parsing fail for some unicode identifiers #44

Closed Rratic closed 1 year ago

Rratic commented 2 years ago
julia> using CommonMark

julia> p=Parser(); enable!(p, TableRule());

julia> md=p("""
       | 标 | 题 | 们 |
       | --- | --- | --- |
       | d | 文 字 | g |
       """); html(md)
"<table><thead><tr><th align=\"left\">标</th><th align=\"left\">题  们</th><th align=\"left\"></th></tr></thead><tbody><tr><td align=\"left\">d</td><td align=\"left\">文 字  g</td><td align=\"left\"></td></tr></tbody></table>"
intended:
d 文 字 g

actual:

题 们
d文 字 g
Rratic commented 1 year ago

It's hard to find out where the problem is.

My progress: function inline_rule in src/extensions/tables.jl should have the maximum of length(rule.pipes) 3 twice, but in reality it's 2 twice, there's nothing wrong with the two statements, so probably something changed the value of rule, which I cannot understand why, at least currently