lib: make code block language non option
no distinction between empty language and None
This commit is contained in:
parent
e79f767604
commit
0484ee2011
2 changed files with 7 additions and 9 deletions
|
@ -290,7 +290,7 @@ pub enum Container<'s> {
|
|||
/// A block with raw markup for a specific output format.
|
||||
RawBlock { format: &'s str },
|
||||
/// A block with code in a specific language.
|
||||
CodeBlock { language: Option<&'s str> },
|
||||
CodeBlock { language: &'s str },
|
||||
/// An inline divider element.
|
||||
Span,
|
||||
/// An inline link, the first field is either a destination URL or an unresolved tag.
|
||||
|
@ -902,9 +902,7 @@ impl<'s> Parser<'s> {
|
|||
if let Some(format) = content.strip_prefix('=') {
|
||||
Container::RawBlock { format }
|
||||
} else {
|
||||
Container::CodeBlock {
|
||||
language: (!content.is_empty()).then(|| content),
|
||||
}
|
||||
Container::CodeBlock { language: content }
|
||||
}
|
||||
}
|
||||
block::Leaf::TableCell(alignment) => Container::TableCell {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue