assertEquals($markdown, html2markdown($html));
}
public function html2markdownProvider() {
return [
'empty text' => [
'',
''
],
'space and nbsp only' => [
' ',
''
],
'strong, b, em, i, bib' => [
'strong bold em italic boitalicld',
'**strong** **bold** _em_ _italic_ **bo_italic_ld**'
],
'empty tags' => [
'text1 text2 ',
'text1 text2'
],
'HTML entities, lt does not work' => [
'& gt > lt <',
'& gt > lt'
],
'escaped HTML entities' => [
'& lt < gt >',
'& lt < gt >'
],
'our escaped HTML entities' => [
'&_lt_; &_gt_; &_amp_;',
'&\_lt\_; &\_gt\_; &\_amp\_;'
],
'linebreak' => [
"line1
line2\nline3",
"line1 \nline2 line3"
],
'headlines' => [
'
somethingblah', "> something\n\nblah" ], 'code' => [ '
<p>HTML text</p>
',
'`HTML text
`' ], 'pre' => [ 'line with spaces', '` line with spaces `' ], 'div p' => [ '
p