From e3c4c5a91c7eafbd80a143c1e02e33dc3b26ea04 Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Fri, 9 May 2025 13:12:54 +0200 Subject: [PATCH] Fix handling of unicode when counting codeblock lines (#30364) Release Notes: - N/A --- crates/markdown/src/parser.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/markdown/src/parser.rs b/crates/markdown/src/parser.rs index 7c18a12001..e5e5847289 100644 --- a/crates/markdown/src/parser.rs +++ b/crates/markdown/src/parser.rs @@ -80,8 +80,8 @@ pub fn parse_markdown( content_range.start + range.start..content_range.end + range.start; let line_count = text[content_range.clone()] - .bytes() - .filter(|c| *c == b'\n') + .chars() + .filter(|c| *c == '\n') .count(); let metadata = CodeBlockMetadata { content_range,