block: specify lang in code block event
instead of using span
This commit is contained in:
parent
e90594f2b7
commit
dbedeeb5ee
2 changed files with 19 additions and 17 deletions
|
@ -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 {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue