Skip to content

Commit

Permalink
thephpleague#226: Escape setext heading underlines.
Browse files Browse the repository at this point in the history
  • Loading branch information
olli7 committed Aug 25, 2022
1 parent e0fc8cf commit 782c7e7
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/Converter/ParagraphConverter.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ private function escapeFirstCharacters(string $line): string
'~~~',
'---',
'- - -',
'=',
];

foreach ($escapable as $i) {
Expand Down
1 change: 1 addition & 0 deletions tests/HtmlConverterTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,7 @@ public function testSanitization(): void
$this->assertHtmlGivesMarkdown($html, $markdown);
$this->assertHtmlGivesMarkdown('<p>&gt; &gt; Look at me! &lt; &lt;</p>', '&gt; &gt; Look at me! &lt; &lt;');
$this->assertHtmlGivesMarkdown('<p>&gt; &gt; <b>Look</b> at me! &lt; &lt;<br />&gt; Just look at me!</p>', "&gt; &gt; **Look** at me! &lt; &lt; \n&gt; Just look at me!");
$this->assertHtmlGivesMarkdown('<p>Foo<br>=<br>Bar</p>', "Foo \n\\= \nBar");
$this->assertHtmlGivesMarkdown('<p>Foo<br>--<br>Bar<br>Foo--</p>', "Foo \n\\-- \nBar \nFoo--");
$this->assertHtmlGivesMarkdown('<ul><li>Foo<br>- Bar</li></ul>', "- Foo \n \\- Bar");
$this->assertHtmlGivesMarkdown('Foo<br />* Bar', "Foo \n\\* Bar");
Expand Down

0 comments on commit 782c7e7

Please sign in to comment.