Skip to content

suggestion:html.escape(s, quote=True) escape \n to <br /> #76547

Closed

Description

@redstone-cold
BPO 32366
Nosy @bitdancer

Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

Show more details

GitHub fields:

assignee = None
closed_at = <Date 2017-12-18.14:08:09.320>
created_at = <Date 2017-12-18.11:37:43.030>
labels = ['type-feature', 'library']
title = 'suggestion:html.escape(s, quote=True) escape  \\n to <br />'
updated_at = <Date 2017-12-18.14:08:09.317>
user = 'https://bugs.python.org/redstone-cold'

bugs.python.org fields:

activity = <Date 2017-12-18.14:08:09.317>
actor = 'r.david.murray'
assignee = 'none'
closed = True
closed_date = <Date 2017-12-18.14:08:09.320>
closer = 'r.david.murray'
components = ['Library (Lib)']
creation = <Date 2017-12-18.11:37:43.030>
creator = 'redstone-cold'
dependencies = []
files = []
hgrepos = []
issue_num = 32366
keywords = []
message_count = 2.0
messages = ['308546', '308560']
nosy_count = 2.0
nosy_names = ['r.david.murray', 'redstone-cold']
pr_nums = []
priority = 'normal'
resolution = 'rejected'
stage = 'resolved'
status = 'closed'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue32366'
versions = []

Activity

  1. redstone-cold commented on Dec 18, 2017

    redstone-coldmannequin
    MannequinAuthor

    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

  2. added
    type-feature
    on Dec 18, 2017
  3. bitdancer commented on Dec 18, 2017

    @bitdancer
    Member

    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.

  4. added
    stdlib
    and removed on Dec 18, 2017
  5. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    stdlibtype-feature

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions