lib: code block lang -> language

This commit is contained in:
Noah Hellman 2023-05-10 23:34:45 +02:00
parent 924a3c35bb
commit e79f767604
2 changed files with 4 additions and 4 deletions

View file

@ -266,8 +266,8 @@ impl<'s> Writer<'s> {
};
write!(out, r#" style="text-align: {};">"#, a)?;
}
Container::CodeBlock { lang } => {
if let Some(l) = lang {
Container::CodeBlock { language } => {
if let Some(l) = language {
out.write_str(r#"><code class="language-"#)?;
write_attr(l, &mut out)?;
out.write_str(r#"">"#)?;

View file

@ -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 { lang: Option<&'s str> },
CodeBlock { language: Option<&'s str> },
/// An inline divider element.
Span,
/// An inline link, the first field is either a destination URL or an unresolved tag.
@ -903,7 +903,7 @@ impl<'s> Parser<'s> {
Container::RawBlock { format }
} else {
Container::CodeBlock {
lang: (!content.is_empty()).then(|| content),
language: (!content.is_empty()).then(|| content),
}
}
}