Html2Markdown icon indicating copy to clipboard operation
Html2Markdown copied to clipboard

div-Tags not handled

Open eFloh opened this issue 7 years ago • 3 comments

div tags not handled by the converter.

Expected behavior

´ divtags should be silently removed (without producing output), except when they do not contain another block element. in that case, they should behave as

` tags do

Actual Behaviour

When the HTML source contains <div> tags, the Output still contains them.

Steps to reproduce the Problem

Convert Input <div>Some text</div>

eFloh avatar Jun 08 '18 14:06 eFloh

@eFloh - thanks for contributing.

According to the Markdown spec div tags are supported as is with no conversion. So the actual behaviour is correct by this rationale. In fact it should not even support Markdown elements inside HTML block level elements. I have a bug to fix this #35

baynezy avatar Jun 11 '18 08:06 baynezy

It would be great if this could be added as an option to the Convert method, even if it is technically in violation of the spec, as I think the common case for using the library is to convert HTML which was written without the Markdown spec in mind.

benelliott avatar Jun 12 '19 09:06 benelliott

It would be great if this could be added as an option to the Convert method, even if it is technically in violation of the spec, as I think the common case for using the library is to convert HTML which was written without the Markdown spec in mind.

Agreed, +1 !

JeanThirion avatar Oct 31 '19 23:10 JeanThirion