1
0
mirror of https://github.com/php/web-php.git synced 2026-03-23 23:02:13 +01:00

interactive-examples.js: Enable for informal examples and fix output replacement

This commit is contained in:
AllenJB
2025-09-28 13:18:15 +01:00
committed by Derick Rethans
parent 800460f6c2
commit 9d3f87fffd
2 changed files with 10 additions and 2 deletions

View File

@@ -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

View File

@@ -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");
}
}