diff --git a/src/CommonMark/CodeBlockRenderer.php b/src/CommonMark/CodeBlockRenderer.php index 1f3d0eb..824cc43 100644 --- a/src/CommonMark/CodeBlockRenderer.php +++ b/src/CommonMark/CodeBlockRenderer.php @@ -38,7 +38,7 @@ public function render(Node $node, ChildNodeRendererInterface $childRenderer) if ($theme instanceof WithPre) { return $theme->preBefore() . $parsed . $theme->preAfter(); } else { - return '
' . $parsed . '
'; + return '
' . $parsed . '
'; } } } diff --git a/tests/CommonMark/CodeBlockRendererTest.php b/tests/CommonMark/CodeBlockRendererTest.php index 6ae55fa..4980089 100644 --- a/tests/CommonMark/CodeBlockRendererTest.php +++ b/tests/CommonMark/CodeBlockRendererTest.php @@ -32,6 +32,7 @@ class Foo {} ```"); $this->assertStringContainsString('hl-keyword', $parsed->getContent()); + $this->assertStringContainsString('data-lang="php"', $parsed->getContent()); } public function test_commonmark_with_gutter(): void @@ -52,7 +53,7 @@ class Foo {} TXT; $expected = <<<'TXT' -
10 class Foo {}
+
10 class Foo {}
TXT;