diff --git a/src/calibre/ebooks/pml/pmlml.py b/src/calibre/ebooks/pml/pmlml.py index f6f737275e..854bd7fa5c 100644 --- a/src/calibre/ebooks/pml/pmlml.py +++ b/src/calibre/ebooks/pml/pmlml.py @@ -174,8 +174,8 @@ class PMLMLizer(object): return text def prepare_text(self, text): - # Replace empty paragraphs with \c pml codes used to denote emtpy lines. - text = re.sub(unicode_type(r'(?<=
)\s*]*>[\xc2\xa0\s]*
'), '\\c\n\\c', text) + # Replace empty paragraphs with \c pml codes used to denote empty lines. + text = re.sub(unicode_type(r'(?<=)\s*]*>[\xc2\xa0\s]*
'), r'\\c\n\\c', text) return text def clean_text(self, text): @@ -207,7 +207,7 @@ class PMLMLizer(object): text = re.sub('[ ]{2,}', ' ', text) # Condense excessive \c empty line sequences. - text = re.sub('(\\c\\s*\\c\\s*){2,}', '\\c \n\\c\n', text) + text = re.sub(r'(\\c\\s*\\c\\s*){2,}', r'\\c \n\\c\n', text) # Remove excessive newlines. text = re.sub('\n[ ]+\n', '\n\n', text)