PageAdapter: fix empty lines issues in pre blocks
This commit is contained in:
parent
117c70100f
commit
30d7ce72b8
|
@ -73,9 +73,11 @@ class PageAdapter(private val listener: ContentAdapterListener) :
|
||||||
}
|
}
|
||||||
is PreTextLine -> {
|
is PreTextLine -> {
|
||||||
val lastBlock = blocks.last()
|
val lastBlock = blocks.last()
|
||||||
if (lastBlock is ContentBlock.Pre && !lastBlock.closed)
|
if (lastBlock is ContentBlock.Pre && !lastBlock.closed) {
|
||||||
lastBlock.content += line.text + "\n"
|
if (lastBlock.content.isNotEmpty())
|
||||||
else
|
lastBlock.content += "\n"
|
||||||
|
lastBlock.content += line.text
|
||||||
|
} else {
|
||||||
Log.e(TAG, "setLines: unexpected preformatted line")
|
Log.e(TAG, "setLines: unexpected preformatted line")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in a new issue