Skip to content

Commit 4527baf

Browse files
gen_stub: break up closing tag in DOMCdataSection
Otherwise GitHub's syntax highlighting treats it as the end of the code and stops highlighting
1 parent c6a9bee commit 4527baf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

build/gen_stub.php

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1975,12 +1975,16 @@ private function getExampleSection(DOMDocument $doc, string $id): DOMElement {
19751975

19761976
$prog = $doc->createElement('programlisting');
19771977
$prog->setAttribute('role', 'php');
1978+
// So that GitHub syntax highlighting doesn't treat the closing tag
1979+
// in the DOMCdataSection as indication that it should stop syntax
1980+
// highlighting, break it up
1981+
$empty = '';
19781982
$code = new DOMCdataSection(
19791983
<<<CODE_EXAMPLE
19801984
19811985
<?php
19821986
echo "Code example";
1983-
?>
1987+
?$empty>
19841988
19851989
CODE_EXAMPLE
19861990
);

0 commit comments

Comments
 (0)