mirror of
https://github.com/geometer/FBReaderJ.git
synced 2025-10-05 02:39:23 +02:00
fixed empty line support in <pre>-formatted text
This commit is contained in:
parent
0256b78bf6
commit
995872c344
3 changed files with 7 additions and 2 deletions
|
@ -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 <pre>-formatted text
|
||||
|
||||
===== 1.10.2 (May 25, 2014) =====
|
||||
* Fixed local library duplicates issue
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue