Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Invalid markdown when using image tags followed by a heading #259

Open
tkoenig opened this issue Jan 15, 2025 · 0 comments
Open

Invalid markdown when using image tags followed by a heading #259

tkoenig opened this issue Jan 15, 2025 · 0 comments

Comments

@tkoenig
Copy link

tkoenig commented Jan 15, 2025

Version(s) affected

5.1.1

Description

The parser is not adding a newline between the tag and the subsequent tag, causing the Markdown to be rendered incorrectly.

The following HTML is not being parsed as expected:

<img src="https://placehold.co/600x400" loading="lazy" id="" width="auto" height="auto" alt="" />
<h3 id="">A new header</h3>

Current output

![](https://placehold.co/600x400)### A new header

Expected output

![](https://placehold.co/600x400)

### A new header

How to reproduce

$html = <<<HTML
    <img src="https://placehold.co/600x400" loading="lazy" id="" width="auto" height="auto" alt="" />
    <h3 id="">A new header</h3>
HTML;
$converter =  new HtmlConverter();
$markdown = $converter->convert($html);
echo $markdown;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant