mirror of
https://github.com/helix-editor/helix.git
synced 2024-09-20 16:07:55 +03:00
markdown: Recognize <code>
tags with attributes as code (#8397)
This commit is contained in:
parent
b495ca429a
commit
01e281ce10
@ -184,7 +184,9 @@ fn push_line<'a>(spans: &mut Vec<Span<'a>>, lines: &mut Vec<Spans<'a>>) {
|
||||
// Transform text in `<code>` blocks into `Event::Code`
|
||||
let mut in_code = false;
|
||||
let parser = parser.filter_map(|event| match event {
|
||||
Event::Html(tag) if *tag == *"<code>" => {
|
||||
Event::Html(tag)
|
||||
if tag.starts_with("<code") && matches!(tag.chars().nth(5), Some(' ' | '>')) =>
|
||||
{
|
||||
in_code = true;
|
||||
None
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user