You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
suggestion:html.escape(s, quote=True) escape \n to <br /> #76547
The point of html.escape is to sanitize a string that contains html such that *it does not get interpreted as html*. So adding html markup would go against its purpose. Further, including <br /> in an attribute value (which is the purpose of quote=True) would make no sense and serve no purpose that I can see.
Clearly you have a use case in mind, but you did not describe it. I would recommend posting to the python-list mailing list for advice on the best way to accomplish your use case.
Activity
redstone-cold commentedon Dec 18, 2017
It would be better if html.escape(s, quote=True) could escape linefeed to <br />
https://docs.python.org/3/library/html.html#html.escape
bitdancer commentedon Dec 18, 2017
The point of html.escape is to sanitize a string that contains html such that *it does not get interpreted as html*. So adding html markup would go against its purpose. Further, including <br /> in an attribute value (which is the purpose of quote=True) would make no sense and serve no purpose that I can see.
Clearly you have a use case in mind, but you did not describe it. I would recommend posting to the python-list mailing list for advice on the best way to accomplish your use case.