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

Michael Sloan created

Release Notes:

- N/A

Change summary

crates/markdown/src/parser.rs | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Detailed changes

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,