Now i ran into some stupid situation. I want the users to be able to use textile, but they shouldn't mess around with my valid HTML around their entry. So I have to escape the HTML somehow.
html_escape(textilize("</body>Foo"))
would break textile while
textilize(html_escape("</body>Foo"))
would work, but breaks various Textile features like links (written like "Linkname":http://www.wheretogo.com/
), since the quotes would be transformed into "
and thus not detected by textile anymore.
sanitize
doesn't do a better job.
Any suggestions on that one? I would prefer not to use Tidy for this problem.
Thanks in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…