mirror of
https://github.com/getpelican/pelican.git
synced 2025-10-15 20:28:56 +02:00
Merge remote-tracking branch 'davidjb/decode-html-wp-titles' into wp-import-improvements
Conflicts: docs/changelog.rst
This commit is contained in:
commit
1b23a4a8e1
4 changed files with 71 additions and 4 deletions
|
|
@ -1,6 +1,7 @@
|
|||
#!/usr/bin/env python
|
||||
|
||||
import argparse
|
||||
from HTMLParser import HTMLParser
|
||||
import os
|
||||
import subprocess
|
||||
import sys
|
||||
|
|
@ -29,7 +30,8 @@ def wp2fields(xml):
|
|||
if item.fetch('wp:status')[0].contents[0] == "publish":
|
||||
|
||||
try:
|
||||
title = item.title.contents[0]
|
||||
# Use HTMLParser due to issues with BeautifulSoup 3
|
||||
title = HTMLParser().unescape(item.title.contents[0])
|
||||
except IndexError:
|
||||
continue
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue