HTML Mode is also filtering inverse, paragraphs, etc. #74
Replies: 1 comment 2 replies
-
Thanks for the suggestion. I'll see what I can do. I'll put it into the discussion because it's not a issue :) PS. |
Beta Was this translation helpful? Give feedback.
-
First of all, thanks for your great work.
I would like to use this lib for an html block and it filters a lot of html tags out of the original text. For example:
<p>This is a paragraph with <b>bold</b> and <i>italic</i>Text.</p>
becomes:
This is a paragraph with <b>bold</b> and italic Text.
This has the effect, that my truncated text is not css formated any more, i.e. paragraphs have no padding afterwards.
To avoid this, I hacked 2 changes in the lib and now it works for me. First of all, I think it is better to use this solution for the function htmlString:
https://stackoverflow.com/questions/6003271/substring-text-with-html-tags-in-javascript#6004268
Could you use this html function in your lib or provide a callback function as option, so that I could use my own?
Then I turned off all regex replacements (I don't know why these are needed anyway, the htmlString function does a great job and in my opinion, nothing else needs to be done here. So could you add a way to deactivate the default regex replacements?
After these 2 changes, your lib works perfect for html (at least in my cases).
Thanks again for your work!
Beta Was this translation helpful? Give feedback.
All reactions