We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 469d10f commit 501a37aCopy full SHA for 501a37a
1 file changed
js/interactive-examples.js
@@ -94,11 +94,13 @@ async function main() {
94
95
const runPhp = await PHP.loadPhp();
96
runPhp(phpcode.innerText);
97
+ const output = PHP.buffer.join("").replace(/^\n+|\n+$/g, "");
98
+
99
if (exampleScreenPreElement !== null) {
100
exampleTitleParagraphElement.innerText = generateExampleOutputTitle(PHP.version);
- exampleScreenPreElement.innerText = PHP.buffer.join("");
101
+ exampleScreenPreElement.innerText = output;
102
} else {
- lastOutput = createOutput(PHP.buffer.join(""));
103
+ lastOutput = createOutput(output);
104
phpcode.parentNode.appendChild(lastOutput);
105
}
106
PHP.buffer.length = 0;
0 commit comments