From 2cc26bb1244fd832b1782728b5ef8224cc7581e0 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 19 Feb 2015 10:40:58 +0530 Subject: [PATCH] DOCX Input: Fix regression in 2.19 that broke handling of text with leading or trailing non-breaking spaces/en-spaces/quad-spaces. Fixes #1422844 [disappearing spaces](https://bugs.launchpad.net/calibre/+bug/1422844) --- src/calibre/ebooks/docx/to_html.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/calibre/ebooks/docx/to_html.py b/src/calibre/ebooks/docx/to_html.py index 8ad589c771..08746ae698 100644 --- a/src/calibre/ebooks/docx/to_html.py +++ b/src/calibre/ebooks/docx/to_html.py @@ -585,7 +585,7 @@ class Convert(object): if space != 'preserve': # Remove leading and trailing whitespace. Word ignores # leading and trailing whitespace without preserve - ctext = ctext.strip() + ctext = ctext.strip(' \n\r\t') # Only use a with white-space:pre-wrap if this element # actually needs it, i.e. if it has more than one # consecutive space or it has newlines or tabs.