diff options
| author | Laurenz <laurmaedje@gmail.com> | 2021-02-04 00:38:30 +0100 |
|---|---|---|
| committer | Laurenz <laurmaedje@gmail.com> | 2021-02-04 00:38:30 +0100 |
| commit | 8de1f8b770b811084f701b9a6b9ac78ce6fa04da (patch) | |
| tree | 46717b98a9536b15d613a88abdc94f0c968b5439 /src | |
| parent | d86a5e8a1f469dd79abf3137dba77a71fae2a774 (diff) | |
Fix counting bug ✅
Diffstat (limited to 'src')
| -rw-r--r-- | src/syntax/mod.rs | 2 | ||||
| -rw-r--r-- | src/syntax/node.rs | 3 |
2 files changed, 4 insertions, 1 deletions
diff --git a/src/syntax/mod.rs b/src/syntax/mod.rs index 2a8c4dbb..af6715c6 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 7b6aa728..b4866068 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; |
