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 -> {
|
||||
val lastBlock = blocks.last()
|
||||
if (lastBlock is ContentBlock.Pre && !lastBlock.closed)
|
||||
lastBlock.content += line.text + "\n"
|
||||
else
|
||||
if (lastBlock is ContentBlock.Pre && !lastBlock.closed) {
|
||||
if (lastBlock.content.isNotEmpty())
|
||||
lastBlock.content += "\n"
|
||||
lastBlock.content += line.text
|
||||
} else {
|
||||
Log.e(TAG, "setLines: unexpected preformatted line")
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue