From 7610a7b77347fca0cc18481e46ff6ace1a2a86a6 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 3 Feb 2011 20:42:19 -0700 Subject: [PATCH] ... --- src/calibre/ebooks/pml/pmlml.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/calibre/ebooks/pml/pmlml.py b/src/calibre/ebooks/pml/pmlml.py index 582854bc69..41c38283ab 100644 --- a/src/calibre/ebooks/pml/pmlml.py +++ b/src/calibre/ebooks/pml/pmlml.py @@ -16,7 +16,6 @@ from calibre.ebooks.oeb.base import XHTML, XHTML_NS, barename, namespace from calibre.ebooks.oeb.stylizer import Stylizer from calibre.ebooks.pdb.ereader import image_name from calibre.ebooks.pml import unipmlcode -from calibre.utils.cleantext import clean_ascii_chars TAG_MAP = { 'b' : 'B', @@ -192,7 +191,7 @@ class PMLMLizer(object): # Remove excessive spaces text = re.sub('[ ]{2,}', ' ', text) - + # Condense excessive \c empty line sequences. text = re.sub('(\\c\s*\\c\s*){2,}', '\\c \n\\c\n', text) @@ -248,7 +247,7 @@ class PMLMLizer(object): text.append(w) elif tag == 'br': text.append('\n\\c \n\\c\n') - + # TOC markers. toc_name = elem.attrib.get('name', None) toc_id = elem.attrib.get('id', None) @@ -299,7 +298,7 @@ class PMLMLizer(object): if style_tag and style_tag not in tag_stack+tags: text.append('\\%s' % style_tag) tags.append(style_tag) - + # margin left try: mms = int(float(style['margin-left']) * 100 / style.height) @@ -307,7 +306,7 @@ class PMLMLizer(object): text.append('\\T="%s%%"' % mms) except: pass - + # Soft scene breaks. try: ems = int(round((float(style.marginTop) / style.fontSize) - 1)) @@ -350,7 +349,7 @@ class PMLMLizer(object): text.append('\n\n') else: # closing \c and \r need to be placed - # on the next line per PML spec. + # on the next line per PML spec. if tag in ('c', 'r'): text.append('\n\\%s' % tag) else: