assertConversion( '

Dogcat

Some bold text

', "# Dogcat\n\nSome **bold** text" ); } public function test_callouts_remain_html() { $this->assertConversion( '

Dogcat

Some callout text

Another line

', "# Dogcat\n\n

Some callout text

\n\nAnother line" ); } public function test_wysiwyg_code_format_handled_cleanly() { $this->assertConversion( '

Dogcat

' . "\r\n" . '
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( '', "- [x] Item A\n- [ ] Item B" ); } 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); } } }