lib: code block lang -> language
This commit is contained in:
parent
924a3c35bb
commit
e79f767604
2 changed files with 4 additions and 4 deletions
|
@ -266,8 +266,8 @@ impl<'s> Writer<'s> {
|
||||||
};
|
};
|
||||||
write!(out, r#" style="text-align: {};">"#, a)?;
|
write!(out, r#" style="text-align: {};">"#, a)?;
|
||||||
}
|
}
|
||||||
Container::CodeBlock { lang } => {
|
Container::CodeBlock { language } => {
|
||||||
if let Some(l) = lang {
|
if let Some(l) = language {
|
||||||
out.write_str(r#"><code class="language-"#)?;
|
out.write_str(r#"><code class="language-"#)?;
|
||||||
write_attr(l, &mut out)?;
|
write_attr(l, &mut out)?;
|
||||||
out.write_str(r#"">"#)?;
|
out.write_str(r#"">"#)?;
|
||||||
|
|
|
@ -290,7 +290,7 @@ pub enum Container<'s> {
|
||||||
/// A block with raw markup for a specific output format.
|
/// A block with raw markup for a specific output format.
|
||||||
RawBlock { format: &'s str },
|
RawBlock { format: &'s str },
|
||||||
/// A block with code in a specific language.
|
/// A block with code in a specific language.
|
||||||
CodeBlock { lang: Option<&'s str> },
|
CodeBlock { language: Option<&'s str> },
|
||||||
/// An inline divider element.
|
/// An inline divider element.
|
||||||
Span,
|
Span,
|
||||||
/// An inline link, the first field is either a destination URL or an unresolved tag.
|
/// 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 }
|
Container::RawBlock { format }
|
||||||
} else {
|
} else {
|
||||||
Container::CodeBlock {
|
Container::CodeBlock {
|
||||||
lang: (!content.is_empty()).then(|| content),
|
language: (!content.is_empty()).then(|| content),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue