assertEquals($markdown, Markdown::from_html($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 >'
],
'linebreak' => [
"line1
line2\nline3",
"line1 \nline2 line3"
],
'headlines' => [
'
somethingblah', "> something\n\nblah" ], 'code' => [ '
<p>HTML text</p>
',
'`HTML text
`' ], 'pre' => [ 'one line with spaces', "```\n one line with spaces \n```" ], 'div p' => [ '
p