fix: separate block elements from the inline content before them
An image or link right before a heading or paragraph ended up on the same line, e.g. `### A`. Fixes #259
This commit is contained in:
1 parent
6b7a074e8d
commit
1bb05d0606
2 files changed
+29
-3
No files matched your search
@@ -134,6 +134,10 @@ class HtmlConverterTest extends TestCase
|
||||
public function testImage(): void
|
||||
{
|
||||
$this->assertHtmlGivesMarkdown('<img src="/path/img.jpg" alt="alt text" title="Title" />', '');
|
||||
$this->assertHtmlGivesMarkdown("<img src=\"a.png\" />\n<h3>A new header</h3>", "\n\n### A new header");
|
||||
$this->assertHtmlGivesMarkdown('<img src="a.png" /><p>Paragraph</p>', "\n\nParagraph");
|
||||
$this->assertHtmlGivesMarkdown('<a href="b.html"><img src="a.png" /></a><h3>A new header</h3>', "[](b.html)\n\n### A new header");
|
||||
$this->assertHtmlGivesMarkdown('<blockquote><img src="a.png" /><p>Paragraph</p></blockquote>', "> \n> \n> Paragraph");
|
||||
}
|
||||
|
||||
public function testAnchor(): void
|
||||
|
||||
Reference in new issue
Block a user