diff --git a/src/resources/pandoc/datadir/lpegshortcode.lua b/src/resources/pandoc/datadir/lpegshortcode.lua index 37a706960d4..92046ab1b79 100644 --- a/src/resources/pandoc/datadir/lpegshortcode.lua +++ b/src/resources/pandoc/datadir/lpegshortcode.lua @@ -321,13 +321,13 @@ local function string_to_hex(str) end local md_shortcode_2_uuid = "b58fc729-690b-4000-b19f-365a4093b2ff" -local md_shortcode_2_uuid_pattern = "b58fc729%-690b%-4000%-b19f%-365a4093b2ff%-" +local md_shortcode_2_uuid_pattern = "b58fc729%-690b%-4000%-b19f%-365a4093b2ff;" local function md_escaped_shortcode_2_fun(s) return table.concat({ md_shortcode_2_uuid, - "-", + ";", string_to_hex("{{{<" .. s .. ">}}}"), - "-" + ";" }) end @@ -340,9 +340,9 @@ local function md_shortcode_2_fun(open, space, lst, close) raw = raw .. close return table.concat({ md_shortcode_2_uuid, - "-", + ";", string_to_hex(raw), - "-" + ";" }); end diff --git a/src/resources/pandoc/datadir/readqmd.lua b/src/resources/pandoc/datadir/readqmd.lua index 570584cd76d..2099edb4b33 100644 --- a/src/resources/pandoc/datadir/readqmd.lua +++ b/src/resources/pandoc/datadir/readqmd.lua @@ -121,7 +121,7 @@ local function hex_to_string(hex) end local function readqmd(txt, opts) - local uuid_pattern = "b58fc729%-690b%-4000%-b19f%-365a4093b2ff%-([A-Fa-f0-9]+)%-" + local uuid_pattern = "b58fc729%-690b%-4000%-b19f%-365a4093b2ff;([A-Fa-f0-9]+);" local tags txt = md_fenced_div.attempt_to_fix_fenced_div(txt) txt, tags = escape_invalid_tags(txt) diff --git a/tests/docs/shortcodes/.gitignore b/tests/docs/shortcodes/.gitignore index 075b2542afb..0e3521a7d0f 100644 --- a/tests/docs/shortcodes/.gitignore +++ b/tests/docs/shortcodes/.gitignore @@ -1 +1,3 @@ /.quarto/ + +**/*.quarto_ipynb diff --git a/tests/docs/smoke-all/2026/01/19/13913.qmd b/tests/docs/smoke-all/2026/01/19/13913.qmd new file mode 100644 index 00000000000..28cff8487e4 --- /dev/null +++ b/tests/docs/smoke-all/2026/01/19/13913.qmd @@ -0,0 +1,19 @@ +--- +title: Shortcode with trailing punctuation +format: html +_quarto: + tests: + html: + ensureFileRegexMatches: + - + - '
Normal shortcode: [0-9]+\.[0-9]+\.[0-9]+
' + - 'Shortcode with trailing dash: [0-9]+\.[0-9]+\.[0-9]+-
' + - 'Shortcode with trailing semicolon: [0-9]+\.[0-9]+\.[0-9]+;suffix
' + - [] +--- + +Normal shortcode: {{< version >}} + +Shortcode with trailing dash: {{< version >}}- + +Shortcode with trailing semicolon: {{< version >}};suffix