assertConversion( '
Some bold text
', "# Dogcat\n\nSome **bold** text" ); } public function test_callouts_remain_html() { $this->assertConversion( 'Some callout text
Another line
', "# Dogcat\n\nSome callout text
\n\nAnother line" ); } public function test_wysiwyg_code_format_handled_cleanly() { $this->assertConversion( 'var a = \'cat\';
Another line
', "# Dogcat\n\n```JavaScript\nvar a = 'cat';\n```\n\nAnother line" ); } public function test_tasklist_checkboxes_are_handled() { $this->assertConversion( 'Test
Beans
', "\n\nBeans" ); } protected function assertConversion(string $html, string $expectedMarkdown, bool $partialMdMatch = false) { $markdown = (new HtmlToMarkdown($html))->convert(); if ($partialMdMatch) { static::assertStringContainsString($expectedMarkdown, $markdown); } else { static::assertEquals($expectedMarkdown, $markdown); } } }