mirror of
https://github.com/typst/typst
synced 2025-05-14 04:56:26 +08:00
Fix counting bug ✅
This commit is contained in:
parent
d86a5e8a1f
commit
8de1f8b770
@ -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 `");
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user