Fix handling of unicode when counting codeblock lines (#30364)

Release Notes:

- N/A
This commit is contained in:
Michael Sloan 2025-05-09 13:12:54 +02:00 committed by GitHub
parent d8980c25d2
commit 857134d6dc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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,