Skip to content

Commit

Permalink
fix(HTML): Use consistent attribute name for programming language
Browse files Browse the repository at this point in the history
  • Loading branch information
nokome committed Aug 31, 2021
1 parent d317c08 commit f9dbfb9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion rust/src/methods/decode/html.rs
Expand Up @@ -90,7 +90,7 @@ fn decode_block(node: &NodeRef, context: &Context) -> Vec<BlockContent> {
let programming_language = if let Some(lang) = element
.attributes
.borrow()
.get(LocalName::from("data-programminglanguage"))
.get(LocalName::from("programming-language"))
{
lang.to_string()
} else {
Expand Down
2 changes: 1 addition & 1 deletion rust/src/methods/encode/html.rs
Expand Up @@ -657,7 +657,7 @@ impl ToHtml for CodeChunk {
">",
&label,
r#"<stencila-code-chunk itemtype="http://schema.stenci.la/CodeChunk" itemscope "#,
&encode_attr("data-programminglanguage", &self.programming_language),
&encode_attr("programming-language", &self.programming_language),
r#"><pre slot="text"><code>"#,
&encode_safe(&self.text),
"</code></pre>",
Expand Down

0 comments on commit f9dbfb9

Please sign in to comment.