I have a problem posting text in a html form. The text (from a textarea) to be posted to a new page to show may have the following properties:
I have tried the following methods:
replace "\r\n" sub-strings to html "br" tag and then post the text to innerHTML of a div or span to keep line breaks. But then I need remove the html part in the text beforehand, otherwise, if the text include a "input" tag, I will then have a input box in the resulted page!
What's more, if I remove html tags, then I will accidently remove the sub string like a < b, b > c, (if '<' and 'b', 'b' and '>' are adjacent, seems StackOverFlow can't deal with it, too!)
So, can anyone save me for this problem? Thanks in advance! By the way, I use ruby on rails on my project.
You could allow MathJax to process <pre>
tags by removing them from the skipTags
array in the text2jax
block of your configuration. See the documentation for more details.