mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2024-12-12 05:20:26 +00:00
Fix lexer for "----" (<hr/>) case
The point is that there may be another character in the string. For example, a space or a line break. Because we check the whole string, not the first 4 characters - we can ignore the variant where it can be "----\s" or "----\r\n" and make the wrong markup. Alternatively: use `startsWith("----")`, but this is a bit more expensive operation.
This commit is contained in:
parent
f45758cb0e
commit
8dfd2fcf9b
@ -235,7 +235,7 @@ normalState:
|
||||
case startsWith("<="):
|
||||
addParagraphIfNeeded()
|
||||
addLine(parseTransclusion(line, state.name))
|
||||
case line == "----":
|
||||
case line[:4] == "----":
|
||||
addParagraphIfNeeded()
|
||||
*ast = append(*ast, Line{id: -1, contents: "<hr/>"})
|
||||
case MatchesImg(line):
|
||||
|
Loading…
Reference in New Issue
Block a user