Commit37b15ba4Recorded20 Jul 2026Repositorysigil-markdown
test: expand inline edge-case corpus (emphasis, code, links, escapes)
Message
Adds emphasis-edge and code-link-edge corpus docs plus goldens generated from the pristine-original parser, locking down the tricky inline semantics (unclosed/empty emphasis, nested markers, empty backticks, links without closing paren, image vs bang, escape at EOL) before further optimization.
Changed
bench/check.sgl | 2 +-
bench/corpus/code-link-edge.md | 27 +++++++++++++++++++++++++++
bench/corpus/emphasis-edge.md | 14 ++++++++++++++
bench/golden/code-link-edge.sxml | 1 +
bench/golden/emphasis-edge.sxml | 1 +
5 files changed, 44 insertions(+), 1 deletion(-)Diff
bench/check.sglmodified
@@ -15,7 +15,7 @@
15
(sigil string)) 16
17
(define corpus−18
(list "mixed" "inline-edge" "elements"))+18
(list "mixed" "inline-edge" "elements" "emphasis-edge" "code-link-edge")) 19
20
(ensure-directory "bench/golden") 21
bench/corpus/code-link-edge.mdadded
@@ -0,0 +1,27 @@
+1
# Code and link edge cases+2
+3
Empty backticks `` and single ` tick alone.+4
Unclosed `code to end of line here.+5
Code `with * and _ and [ ] and ! and \ inside` literal.+6
Adjacent `one``two` codes and `a`b`c` pattern.+7
Code at end of line `tail`+8
Backtick then text `x plain after.+9
+10
Link [text](http://example.com) normal.+11
Link no close paren [text](http://example.com and text.+12
Link empty [](url) and [text]() empty url.+13
Link [text with `code` inside](url) literal text.+14
Bracket [not a link] with no paren after.+15
Bracket [not a link] (space before paren) here.+16
Nested [outer [inner] outer](url) brackets.+17
+18
Image  normal.+19
Image empty  no alt.+20
Image ![alt]() no src.+21
Image no paren ![alt] here.+22
Bang alone ! and bang bracket ![x] no paren.+23
Bang text a!b!c no brackets.+24
+25
Backslash at very end \+26
Escaped bracket \[not link\] and escaped bang \![not image\].+27
Double backslash \\ then text.bench/corpus/emphasis-edge.mdadded
@@ -0,0 +1,14 @@
+1
# Emphasis edge cases+2
+3
Four stars **** and three stars *** and five stars ***** end.+4
Bold with star inside **a*b** and italic with **inside *a**b* done.+5
Adjacent **one**two**three** and *a**b* and *a*b*c* patterns.+6
Empty bold **** and empty ** ** spaced and __ __ underscore.+7
Unclosed **bold to end of line here.+8
Unclosed *italic to end and _under to end.+9
Mixed *_nested markers_* and _*other way*_ around.+10
Star at start *word and end word* alone.+11
Under at start _word and end word_ alone.+12
Bold __under__ and __a_b__ and _a__b_ here.+13
Triple ___three unders___ and ___a___ done.+14
Word**bold**word no spaces and word*em*word tight.bench/golden/code-link-edge.sxmladded
@@ -0,0 +1 @@
+1
(document (h1 "Code and link edge cases") (p "Empty backticks " "`" (code " and single ") " tick alone. Unclosed " (code "code to end of line here. Code ") "with " "*" " and " "_" " and " "[" " ] and ! and " " " "inside" (code " literal. Adjacent ") "one" "`" (code "two") " codes and " (code "a") "b" (code "c") " pattern. Code at end of line " (code "tail") " Backtick then text " "`" "x plain after.") (p "Link " (a (@ (href "http://example.com")) "text") " normal. Link no close paren " (a (@ (href "http://example.com and text. Link empty [](url")) "text") " and " (a (@ (href "")) "text") " empty url. Link " (a (@ (href "url")) "text with `code` inside") " literal text. Bracket " "[" "not a link] with no paren after. Bracket " "[" "not a link] (space before paren) here. Nested " "[" "outer " "[" "inner] outer](url) brackets.") (p "Image " (img (@ (src "src.png") (alt "alt"))) " normal. Image empty " (img (@ (src "src.png") (alt ""))) " no alt. Image " (img (@ (src "") (alt "alt"))) " no src. Image no paren " "!" "[" "alt] here. Bang alone ! and bang bracket " "!" "[" "x] no paren. Bang text a!b!c no brackets.") (p "Backslash at very end " " " "Escaped bracket " "[" "not link" "]" " and escaped bang " "!" "[" "not image" "]" ". Double backslash " "\\" " then text.")) 2
No newline at end of filebench/golden/emphasis-edge.sxmladded
@@ -0,0 +1 @@
+1
(document (h1 "Emphasis edge cases") (p "Four stars " "*" (strong "*" " and three stars ") (em " and five stars ") "*" (strong "*" " end. Bold with star inside ") "a" (em "b") (em " and italic with ") (em "inside ") "a" (strong "b" "*" " done. Adjacent ") "one" (strong "two") "three" (strong " and " "*" "a") "b" (em " and ") "a" (em "b") "c" (em " patterns. Empty bold ") (strong "*" " and empty ") " " (strong " spaced and " (strong) " underscore. Unclosed ") "bold to end of line here. Unclosed " (em "italic to end and " "_" "under to end. Mixed ") (em "nested markers") (em " and " "_") "other way" (em "_" " around. Star at start ") "word and end word" (em " alone. Under at start " (em "word and end word") " alone. Bold " (strong "under") " and " (strong "a" "_" "b") " and " (em "a") (em "b") " here. Triple " (strong "_" "three unders") (em " and ") (strong "a") "_" " done. Word") (em "bold") (em "word no spaces and word") "em" "*" "word tight.")) 2
No newline at end of file