c# - How to subString a block of user generated HTML while preserving formatting? -
I want to make general preview paragraphs with a [read more] link. The problem is, the content I would like to sub-string (), is the text and html written by a user with the WYSIWYG editor.
Of course, I check to ensure that the string is not zero or empty, substrings (), the problem is that I can completely break the HTML tag, the presentation of the whole site is off I can do
The WYSIWYG editor does not seem to make completely formatted HTML, and many times & lt; P & gt; & Lt; / P & gt; Instead of
& lt; Br / & gt; The use of tags seems ... basically, I can not rely well on the formatted tags, etc.
My operation was to remove all the HTML and replace the remaining text, it works, but loses any formatting existing in HTML.
What is the best way to sub-string () Non-site rendering to maintain HTML?
While extracting a list that is not a search for any closing tag via the substrings, Goes off? You can then add the closing tag for any opened tags from the list (in the order specified), which will give you useful HTML ...
Comments
Post a Comment