mirror of
https://github.com/osmarks/mycorrhiza.git
synced 2025-01-19 07:02:51 +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("<="):
|
case startsWith("<="):
|
||||||
addParagraphIfNeeded()
|
addParagraphIfNeeded()
|
||||||
addLine(parseTransclusion(line, state.name))
|
addLine(parseTransclusion(line, state.name))
|
||||||
case line == "----":
|
case line[:4] == "----":
|
||||||
addParagraphIfNeeded()
|
addParagraphIfNeeded()
|
||||||
*ast = append(*ast, Line{id: -1, contents: "<hr/>"})
|
*ast = append(*ast, Line{id: -1, contents: "<hr/>"})
|
||||||
case MatchesImg(line):
|
case MatchesImg(line):
|
||||||
|
Loading…
Reference in New Issue
Block a user