block: specify lang in code block event

instead of using span
This commit is contained in:
Noah Hellman 2023-04-29 18:51:47 +02:00
parent e90594f2b7
commit dbedeeb5ee
2 changed files with 19 additions and 17 deletions

View file

@ -897,12 +897,12 @@ impl<'s> Parser<'s> {
.into(),
},
block::Leaf::DescriptionTerm => Container::DescriptionTerm,
block::Leaf::CodeBlock => {
block::Leaf::CodeBlock { language } => {
self.verbatim = enter;
if let Some(format) = content.strip_prefix('=') {
if let Some(format) = language.strip_prefix('=') {
Container::RawBlock { format }
} else {
Container::CodeBlock { language: content }
Container::CodeBlock { language }
}
}
block::Leaf::TableCell(alignment) => Container::TableCell {