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

Unescaping HTML in WordPress tags and categories. #2578

Merged
merged 3 commits into from Dec 17, 2016

Conversation

felixfontein
Copy link
Contributor

@felixfontein felixfontein commented Dec 4, 2016

Fixes #2557.

@okin: can you test this with your older export?

okin
okin approved these changes Dec 17, 2016
Copy link
Member

@okin okin left a comment

Fixes my case.

@okin
Copy link
Member

@okin okin commented Dec 17, 2016

Worked for me with Python 3.5 and code looks sane to me aswell.

Thank you @felixfontein!

@felixfontein felixfontein requested a review from Kwpolska Dec 17, 2016
@felixfontein
Copy link
Contributor Author

@felixfontein felixfontein commented Dec 17, 2016

Good to hear! I'd like @Kwpolska to also take a look, especially at the function in utils, before we merge.



# http://stackoverflow.com/a/2087433
if sys.version_info[0] == 3 and sys.version_info[1] >= 4:
Copy link
Member

@Kwpolska Kwpolska Dec 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Breaks with Python 4.0.

I’d suggest:

try:
    import html
    html_unescape = html.unescape
except (AttributeError, ImportError):
    try:
        # the whole ordeal

Or even don’t use html.unescape and always define our own.

Copy link
Contributor Author

@felixfontein felixfontein Dec 17, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, that sounds better. About defining my own: doesn't sound like a very appealing idea to me.

@felixfontein felixfontein force-pushed the wordpress-import-unescape-tags branch from e49fb3e to 1f273f1 Compare Dec 17, 2016
@felixfontein felixfontein merged commit 3c45cd9 into master Dec 17, 2016
3 of 5 checks passed
@Kwpolska Kwpolska deleted the wordpress-import-unescape-tags branch May 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants