Closed tlienart closed 3 years ago
The error it's giving is saying that there isn't a default parsing function to handle block parsing when nothing else matches. Have you tried adding the SkipIndented
rule in the linked comment? You need to have a rule that handles the empty string, which is normally handled by IndentedCodeBlockRule
.
julia> struct SkipIndented end;
julia> CommonMark.block_rule(::SkipIndented) = CommonMark.Rule((p, c) -> 0, 8, "");
julia> p = Parser();
julia> enable!(p, (TableRule(), SkipIndented()));
julia> disable!(p, IndentedCodeBlockRule());
julia> s = """
tables:
| abc | def |
| --- | ----|
| 0 | 1|
end
""";
julia> p(s)
tables:
┏━━━━━┯━━━━━┓
┃ abc │ def ┃
┠─────┼─────┨
┃ 0 │ 1 ┃
┗━━━━━┷━━━━━┛
end
apologies this is on me with the ---
block that was getting caught inside the table as a hrule on my side blocking CM from seeing the full table and crashing as a result.
Example
Stacktrace
removing the
disable!
withIndentedCodeBlockRule
avoids this but I do want to disable that rule (as per https://github.com/MichaelHatherly/CommonMark.jl/issues/1#issuecomment-735990126). Any suggestions?Thanks