Skip to content

Commit a10b7c4

Browse files
committed
Fix PHP Syntax highlighting
1 parent aa0eb2a commit a10b7c4

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

src/PHPFUI/InstaDoc/MarkDownParser.php

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ public function fileText(string $filename) : string
2020

2121
public function html(string $markdown) : string
2222
{
23-
$markdown = \str_replace('<?php', '', $markdown);
2423
$html = $this->parser->convert($markdown);
2524

2625
return \str_replace(['<p>', '</p>'], '', "{$html}");
@@ -43,7 +42,7 @@ public function text(string $markdown) : string
4342
$highlighted = $hl->highlight('php', $child->text());
4443
$block->setAttribute('class', 'hljs ' . $highlighted->language);
4544
$block->parentNode()->setAttribute('class', 'hljs ' . $highlighted->language);
46-
$child->plaintext = \htmlspecialchars_decode($highlighted->value);
45+
$child->outertext = \htmlspecialchars_decode($highlighted->value);
4746
}
4847
$div->add("{$dom}");
4948

0 commit comments

Comments
 (0)