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

Fixes #2557.

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

Copy link
Member

@okin okin left a comment

Choose a reason for hiding this comment

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

Fixes my case.

@okin
Copy link
Member

okin commented Dec 17, 2016

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

Thank you @felixfontein!

@felixfontein
Copy link
Contributor Author

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

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

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 merged commit 3c45cd9 into master Dec 17, 2016
@Kwpolska Kwpolska deleted the wordpress-import-unescape-tags branch May 20, 2017 15:29
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