Skip to content
This repository has been archived by the owner on Sep 27, 2024. It is now read-only.

Conversion between html and markdown in Rust with whitespace #407

Closed
alunturner opened this issue Dec 15, 2022 · 1 comment
Closed

Conversion between html and markdown in Rust with whitespace #407

alunturner opened this issue Dec 15, 2022 · 1 comment

Comments

@alunturner
Copy link
Contributor

We currently have a slight issue with converting html to markdown in the rust model. Issue is as follows:

  • html can support whitespace inside tags eg <em>hello </em> is valid html and if a user were to click italic, type 'hello ' and then click italic again to disable the italic mode, this is the html they would have input
  • when we convert this to markdown, the output is _hello _
    • this is not valid markdown due to the space before the final underscore
    • this means that if we try to parse that markdown back into html we get the output _hello _

In summary, converting html => markdown => html at the moment is not perfect due to the difference in how the formats handle whitespace at the end of a 'node'.

@jonnyandrew
Copy link
Contributor

Closing as we don't currently aim to produce machine-readable markdown that can do round-trips to/from HTML (see #800).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants