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' => [ '

header1

Header 3

', "header1\n=======\n\n### Header 3" ], 'unordered list' => [ '', "- Item 1\n- Item 2\n- Item **3**" ], 'ordered list' => [ '
  1. Item 1
  2. Item 2
  3. Item 3
', "1. Item 1\n2. Item 2\n3. Item **3**" ], 'nested lists' => [ '', "- Item 1\n 1. Item 1a\n 2. Item **1b**\n- Item 2" ], 'img' => [ 'alt text', '![alt text](/path/to/img.png "title text")' ], 'link' => [ 'link', '[link](http://hubzilla.org "Hubzilla")' ], 'img link' => [ 'alt img text', '[![alt img text](/img/hubzilla.png "img title")](http://hubzilla.org "Hubzilla")' ], 'script' => [ "", "" ], 'blockquote, issue #793' => [ '
something
blah', "> something\n\nblah" ], 'code' => [ '<p>HTML text</p>', '`

HTML text

`' ], 'pre' => [ '
   line with  spaces   
', '` line with spaces `' ], 'div p' => [ '
div

p

', "
div
p\n\n
" ] ]; } /*public function testHtml2markdownException() { //$this->expectException(\InvalidArgumentException::class); // need to stub logger() for this to work $this->assertEquals('', html2markdown('<getFunctionMock(__NAMESPACE__, "bbcode"); $bbc->expects($this->once())->willReturn('testbold
i
'); $this->assertEquals($bb1, bb2diaspora($html1)); } */ }