thephpleague / html-to-markdown

Convert HTML to Markdown with PHP
MIT License
1.77k stars 204 forks source link

Do you support the reserved space parameter #234

Closed ClearSeve closed 1 year ago

ClearSeve commented 1 year ago

Want to   keep as is

<code> &nbsp;</code>

Convert to

`&nbsp;`

Include other invisible characters

colinodell commented 1 year ago

Hi there!

To get your desired Markdown you'd need to have HTML like this:

<code> &amp;nbsp;</code>

This is because &nbsp; in HTML is converted into a literal non-breaking space character, both in your browser and in this library. See https://jsbin.com/fupupoyupe/edit?html,output for an example.