python-markdownify icon indicating copy to clipboard operation
python-markdownify copied to clipboard

Ignored div tag removes spaces.

Open pdc1 opened this issue 1 month ago • 0 comments

When I set skip=["div"] and convert the following HTML,

<span>Ignored <div>Still ignored</div> tag.</span>

The result is IgnoredStill ignoredtag. I was expecting Ignored Still ignored tag.

Then I tried extending the converter class, so convert_div(...) returns " " + text + " ", but that resulted in a trailing space if div was the last tag (e.g., <span>Ignored <div>Still ignored</div></span> converts to Ignored Still ignored <- trailing space).

Shouldn't the trailing space have been stripped by the default strip_document=STRIP?

pdc1 avatar Dec 15 '25 17:12 pdc1