-
-
Notifications
You must be signed in to change notification settings - Fork 212
Open
Description
Version(s) affected
5.1.1
Description
Codeblocks with closing </body>
or </html>
tags will add closing tags to the resulting document.
<pre><code></body></code></pre>
```
</body>
```
</body>
or
```
</html>
```
</body></html>
The issue occurs only once, i.e. having multiple closing html
tags will still return the whole document + only one </body></html>
.
I guess it's somehow about how the HTML is saved. I can work around this with first replacing these tags with placeholders before conversion and replacing them back, but as long as I'm not sure, why this happens, it might occur for the next best element.
How to reproduce
echo -e '<pre><code></body></code></pre>' | vendor/bin/html-to-markdown
echo -e '<pre><code></html></code></pre>' | vendor/bin/html-to-markdown
<?php
include 'vendor/autoload.php';
$converter = new \League\HTMLToMarkdown\HtmlConverter();
echo $converter->convert('<pre><code></html></code></pre>');
Metadata
Metadata
Assignees
Labels
No labels