Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unescape example @ 2.17 在字符串中处理html和xml not working on Python3.9 #342

Open
xiaobojiang opened this issue Jan 21, 2021 · 2 comments

Comments

@xiaobojiang
Copy link

xiaobojiang commented Jan 21, 2021

Original example

s = 'Spicy "Jalapeño&quot.'
from html.parser import HTMLParser
p = HTMLParser()
p.unescape(s)
'Spicy "Jalapeño".'

after Python 3.9, 'HTMLParser' object has no attribute 'unescape', this method is removed.

a working example of Python 3.9 :
s = 'Spicy "Jalapeño&quot.'
import html
p = html
p.unescape(s)

ref link: coursera-dl/coursera-dl#778

@zlu27
Copy link
Contributor

zlu27 commented Feb 20, 2021

@xiaobojiang
Should we add some "translator comments"?

@xiaobojiang
Copy link
Author

good idea.
we could do it in the footer area, or add a note in below.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants