-
-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Option to allow inline HTML #11
Comments
This won't be included in the next release as it'll require a lot of work to ensure "cleaned" elements (and especially their children) are formatted as you'd expect (e.g. indentation). |
I would appreciate having inline html that can't be converted to markdown left intact. |
+1 @jaredly about leaving raw Currently, I don't want to change all tables, only some (due to size). I am wondering if we could have the |
@jaredly A lot of elements that can't be converted are just removed (e.g. @toddb Great idea! I'll definitely consider that when looking at implementing this. |
It does seem to me that the first (experimental) versions of this feature could be 'buyer beware' - if you include raw html you should have cleaned it first. In practice, this is what I am doing with tidy and some custom cleaning because my html is so raw. (I am doing one-off migration of content and suspect this isn't your key use case) |
Fwiw, I'm currently using this lib because it strips all HTML which can't be converted. I'm using it to convert Word docs into Markdown, so it's a long process with lots of crazy tags. So if an option is added to keep inline HTML, I would really appreciate this being optional. Also, thanks so much for this lib! 🌟 |
When enabled (via the options) the parser should only clean specified HTML elements (i.e. remove all of their attributes) instead of replacing them with Markdown. When "cleaning" an element, all of its children will also be "cleaned" by the parser instead of converted into Markdown.
This functionality will be extremely useful when using tables.
The option should allow users to specify an array of specific tags;
In this example it would "clean" all
<p>
and<table>
tags, along with all their children.The text was updated successfully, but these errors were encountered: