Fix more python 3.6 regex DeprecationWarning's

This commit is contained in:
derwinlu 2017-03-29 10:19:47 +02:00
commit 623eb0a4c0
5 changed files with 26 additions and 26 deletions

View file

@ -88,7 +88,7 @@ def decode_wp_content(content, br=True):
content = re.sub(r'<p><blockquote([^>]*)>', "<blockquote\\1><p>", content)
content = content.replace('</blockquote></p>', '</p></blockquote>')
content = re.sub(r'<p>\s*(</?' + allblocks + '[^>]*>)', "\\1", content)
content = re.sub(r'(</?' + allblocks + '[^>]*>)\s*</p>', "\\1", content)
content = re.sub(r'(</?' + allblocks + r'[^>]*>)\s*</p>', "\\1", content)
if br:
def _preserve_newline(match):
return match.group(0).replace("\n", "<WPPreserveNewline />")