diff --git a/ChangeLog b/ChangeLog index 5698e4fc9..e1416e1c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -3,6 +3,7 @@ * better cover detection for ePubs * Arabic FBReaderJ resources, by Ahmed Saidi (https://github.com/boussouira) * Updated German localization (by Matthias Dill) +* ePub: fixed empty line support in
-formatted text ===== 1.10.2 (May 25, 2014) ===== * Fixed local library duplicates issue diff --git a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp index 4cb518959..b2945eb30 100644 --- a/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp +++ b/jni/NativeFormats/fbreader/src/formats/xhtml/XHTMLReader.cpp @@ -314,7 +314,7 @@ void XHTMLTagBodyAction::doAtEnd(XHTMLReader &reader) { void XHTMLTagRestartParagraphAction::doAtStart(XHTMLReader &reader, const char**) { if (reader.myCurrentParagraphIsEmpty) { - bookReader(reader).addData(" "); + bookReader(reader).addFixedHSpace(1); } endParagraph(reader); beginParagraph(reader); @@ -842,6 +842,9 @@ void XHTMLReader::characterDataHandler(const char *text, std::size_t len) { case XHTML_READ_BODY: if (myPreformatted) { if (*text == '\r' || *text == '\n') { + if (myCurrentParagraphIsEmpty) { + myModelReader.addFixedHSpace(1); + } endParagraph(); text += 1; len -= 1; diff --git a/src/org/geometerplus/zlibrary/text/view/ZLTextViewBase.java b/src/org/geometerplus/zlibrary/text/view/ZLTextViewBase.java index 549d02d7a..51c37126c 100644 --- a/src/org/geometerplus/zlibrary/text/view/ZLTextViewBase.java +++ b/src/org/geometerplus/zlibrary/text/view/ZLTextViewBase.java @@ -212,7 +212,8 @@ abstract class ZLTextViewBase extends ZLView { } final int getElementHeight(ZLTextElement element) { - if (element instanceof ZLTextWord) { + if (element instanceof ZLTextWord || + element instanceof ZLTextFixedHSpaceElement) { return getWordHeight(); } else if (element instanceof ZLTextImageElement) { final ZLTextImageElement imageElement = (ZLTextImageElement)element;