Skip to content

Refactor HTMLParser.unescape to use html.entities.html5 #59361

Closed

Description

@ezio-melotti
BPO 15156
Nosy @ezio-melotti, @merwok, @bitdancer
Files
  • issue15156.diff
  • issue15156-2.diff
  • 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 = 'https://github.com/ezio-melotti'
    closed_at = <Date 2012-06-24.20:05:35.901>
    created_at = <Date 2012-06-24.02:45:42.758>
    labels = ['type-feature', 'library']
    title = 'Refactor HTMLParser.unescape to use html.entities.html5'
    updated_at = <Date 2012-06-24.20:05:35.899>
    user = 'https://github.com/ezio-melotti'

    bugs.python.org fields:

    activity = <Date 2012-06-24.20:05:35.899>
    actor = 'ezio.melotti'
    assignee = 'ezio.melotti'
    closed = True
    closed_date = <Date 2012-06-24.20:05:35.901>
    closer = 'ezio.melotti'
    components = ['Library (Lib)']
    creation = <Date 2012-06-24.02:45:42.758>
    creator = 'ezio.melotti'
    dependencies = []
    files = ['26129', '26131']
    hgrepos = []
    issue_num = 15156
    keywords = ['patch']
    message_count = 5.0
    messages = ['163702', '163790', '163811', '163837', '163838']
    nosy_count = 4.0
    nosy_names = ['ezio.melotti', 'eric.araujo', 'r.david.murray', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'enhancement'
    url = 'https://bugs.python.org/issue15156'
    versions = ['Python 3.3']

    Activity

    1. ezio-melotti commented on Jun 24, 2012

      @ezio-melotti
      MemberAuthor

      HTMLParser has an internal method called unescape [0] used to convert named character references to the equivalent characters, and it does so by using html.entities.name2codepoint to recreate the equivalent of html.entities.entityrefs with the addition of '.
      Now that the html5 entities have been added to html.entities, the parser should use them instead of name2codepoint.

      [0]: see Lib/html/parser.py:500

    2. self-assigned this
      on Jun 24, 2012
    3. added
      stdlibStandard Library Python modules in the Lib/ directory
      type-featureA feature request or enhancement
      on Jun 24, 2012
    4. ezio-melotti commented on Jun 24, 2012

      @ezio-melotti
      MemberAuthor

      Here's a patch, please review.

    5. ezio-melotti commented on Jun 24, 2012

      @ezio-melotti
      MemberAuthor

      Patch updated after the review.

    6. python-dev commented on Jun 24, 2012

      python-devmannequin
      Mannequin

      New changeset 0d53703b1a99 by Ezio Melotti in branch 'default':
      bpo-15156: HTMLParser now uses the new "html.entities.html5" dictionary.
      http://hg.python.org/cpython/rev/0d53703b1a99

    7. ezio-melotti commented on Jun 24, 2012

      @ezio-melotti
      MemberAuthor

      Fixed, thanks for the reviews!

    8. 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

    Labels

    stdlibStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancement

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions