Skip to content

Request: option to not translate < or > #158

@luciansmith

Description

@luciansmith

Is your feature request related to a problem? Please describe.
I am using html2md along with another library (maddy) to translate text to and from markdown. My original text sometimes has &lt; and &gt; in it, which html2md translates to actual '<' and '>'. This becomes a problem when translating back to HTML, as those <>'s can look like (or be!) actual elements.

Describe the solution you'd like
HTML like "&lt;em&gt;" should never translate to the markdown "<em>", as that's a different legal HTML that is not what was meant by the original text. HTML like "&lt;=&gt;" could potentially translate to the markdown "<=>", as this is not legal XML, and therefore could potentially be legal 'just text inside HTML tags'. Nonetheless, I would like the option to always leave &lt; and &gt; untranslated, so as to not create markdown that means something other than what it originally was in HTML.

Describe alternatives you've considered
You could just never translate &lt; and &gt;?

Additional context
Nope.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions