This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: suggestion:html.escape(s, quote=True) escape \n to
Type: enhancement Stage: resolved
Components: Library (Lib) Versions:
process
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: r.david.murray, redstone-cold
Priority: normal Keywords:

Created on 2017-12-18 11:37 by redstone-cold, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (2)
msg308546 - (view) Author: iMath (redstone-cold) Date: 2017-12-18 11:37
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
msg308560 - (view) Author: R. David Murray (r.david.murray) * (Python committer) Date: 2017-12-18 14:08
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.
History
Date User Action Args
2022-04-11 14:58:55adminsetgithub: 76547
2017-12-18 14:08:09r.david.murraysetstatus: open -> closed

components: + Library (Lib), - XML

nosy: + r.david.murray
messages: + msg308560
resolution: rejected
stage: resolved
2017-12-18 11:37:43redstone-coldcreate