diff --git a/.editorconfig b/.editorconfig index b6249fbb0..96497cb17 100644 --- a/.editorconfig +++ b/.editorconfig @@ -5,6 +5,10 @@ charset = utf-8 insert_final_newline = true trim_trailing_whitespace = true +[*.js] +indent_size = 2 +indent_style = space + [*.yaml] indent_size = 2 indent_style = space diff --git a/js/interactive-examples.js b/js/interactive-examples.js index 15aef1d8f..7e67c952e 100644 --- a/js/interactive-examples.js +++ b/js/interactive-examples.js @@ -72,10 +72,14 @@ async function main() { let exampleTitleParagraphElement = null; let exampleScreenPreElement = null; if (exampleTitleContainer !== null) { - exampleTitleParagraphElement = exampleTitleContainer.querySelector("p") + if (exampleTitleContainer.tagName === "P") { + exampleTitleParagraphElement = exampleTitleContainer; + } else { + exampleTitleParagraphElement = exampleTitleContainer.querySelector("p") + } const exampleScreenContainer = exampleTitleContainer.nextElementSibling; if (exampleScreenContainer !== null) { - exampleScreenPreElement = exampleScreenContainer.querySelector("pre"); + exampleScreenPreElement = exampleScreenContainer.querySelector("pre"); } }