Skip to content

Commit 01e281c

Browse files
markdown: Recognize <code> tags with attributes as code (#8397)
1 parent b495ca4 commit 01e281c

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

helix-term/src/ui/markdown.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,9 @@ impl Markdown {
184184
// Transform text in `<code>` blocks into `Event::Code`
185185
let mut in_code = false;
186186
let parser = parser.filter_map(|event| match event {
187-
Event::Html(tag) if *tag == *"<code>" => {
187+
Event::Html(tag)
188+
if tag.starts_with("<code") && matches!(tag.chars().nth(5), Some(' ' | '>')) =>
189+
{
188190
in_code = true;
189191
None
190192
}

0 commit comments

Comments
 (0)