diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index 2a8c4dbbd..af6715c6d 100644 --- a/src/syntax/mod.rs +++ b/src/syntax/mod.rs @@ -72,6 +72,8 @@ mod tests { roundtrip("```\n line \n```"); roundtrip("```\n`\n```"); roundtrip("``` ` ```"); + roundtrip("````\n```\n```\n````"); + test("```lang```", "```lang ```"); test("```1 ```", "``"); test("``` 1```", "`1`"); test("``` 1 ```", "`1 `"); diff --git a/src/syntax/node.rs b/src/syntax/node.rs index 7b6aa728f..b48660682 100644 --- a/src/syntax/node.rs +++ b/src/syntax/node.rs @@ -151,8 +151,9 @@ impl Pretty for NodeRaw { // More backticks may be required if there are lots of consecutive // backticks in the lines. - let mut count = 0; + let mut count; for line in &self.lines { + count = 0; for c in line.chars() { if c == '`' { count += 1;