user input content by text editor, and finally submitted to the database. before store in database,i want remove empty line in content at begin and end (the middle can not be removed).
i want use JavaScript and C#
sample content is:
<div>
<p><span><br></span></p>
<span>a<br/>bc</span>
<p>te<br>st</p>
<p>\n<span>\n</span></p>
<p><span><br/></span></p>
</div>
i need is:
<div>
<span>a<br/>bc</span>
<p>te<br>st</p>
</div>
who can help me?
` tags *always* outside `` tags? Can you even rely on the user input tags to be balanced? In your 'sample content', would the line with `\n` be on one (text) line, or would there actually be newlines there in the input string?
– mathematical.coffee Mar 14 '12 at 02:21(or
) create by text editor – artwl Mar 14 '12 at 02:29