i have a <img src=__string__> but string might contain “, what should I do to escape it?
Example:
__string__ = test".jpg
<img src="test".jpg">
doesn’t work.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If your value being escaped might contain quotes, the best thing is to use the
quoteattrmethod: http://docs.python.org/library/xml.sax.utils.html#module-xml.sax.saxutilsThis is referenced right beneath the docs on the cgi.escape() method.