1
0
mirror of https://github.com/BookStackApp/BookStack.git synced 2025-08-07 23:03:00 +03:00

Fixed drawing handling on HTML to Markdown conversion

This commit is contained in:
Dan Brown
2022-04-29 12:17:14 +01:00
parent d3b39fbe50
commit c8a7acb6c7
5 changed files with 55 additions and 3 deletions

View File

@@ -39,6 +39,14 @@ class MarkdownToHtmlTest extends TestCase
);
}
public function test_drawing_blocks_remain_html()
{
$this->assertConversion(
'<div drawio-diagram="190" id="bkmrk--0" contenteditable="false"><img src="http://example.com/uploads/images/drawio/2022-04/drawing-1.png" alt="" /></div>Some text',
'<div drawio-diagram="190"><img src="http://example.com/uploads/images/drawio/2022-04/drawing-1.png" alt=""/></div>' . "\n\nSome text"
);
}
protected function assertConversion(string $html, string $expectedMarkdown, bool $partialMdMatch = false)
{
$markdown = (new HtmlToMarkdown($html))->convert();