From af8c66b69345f6b882e7606ae6800fcdb3b9ab42 Mon Sep 17 00:00:00 2001 From: Christopher Pruijsen Date: Fri, 11 Sep 2026 02:25:05 +0100 Subject: [PATCH] Unescape fenced code info strings before trimming whitespace Character references such as and were trimmed as literal text, so a leading encoded tab or space left an empty first info word and dropped the language class. Decode first (matching cmark), then trim. Fixes #255 --- lib/blocks.js | 2 +- test/regression.txt | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/lib/blocks.js b/lib/blocks.js index 66113617..c74a278b 100644 --- a/lib/blocks.js +++ b/lib/blocks.js @@ -437,7 +437,7 @@ var blocks = { var newlinePos = content.indexOf("\n"); var firstLine = content.slice(0, newlinePos); var rest = content.slice(newlinePos + 1); - block.info = unescapeString(firstLine.trim()); + block.info = unescapeString(firstLine).trim(); block._literal = rest; } else { // indented diff --git a/test/regression.txt b/test/regression.txt index 1703e3e3..46b5e6bb 100644 --- a/test/regression.txt +++ b/test/regression.txt @@ -632,3 +632,36 @@ Entities inside autolinks (#263). .

http://>

```````````````````````````````` + +#255 + +```````````````````````````````` example +``` js +``` +``` js +``` +``` js +``` +```js +``` +```js +``` +```js +``` +```js a +``` +```js a +``` +```js a +``` +. +
+
+
+
+
+
+
+
+
+````````````````````````````````