PDF Output: Workaround for weird added anchor markup rendering with Qt 5.13.2

This commit is contained in:
Kovid Goyal 2019-11-03 15:10:36 +05:30
parent b21132b428
commit f362901931
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -408,14 +408,15 @@ def add_anchors_markup(root, uuid, anchors):
body = last_tag(root)
div = body.makeelement(
XHTML('div'), id=uuid,
style='display:block; page-break-before: always; break-before: always;'
style='display:block !important; page-break-before: always !important; break-before: always !important; white-space: pre-wrap !important'
)
div.text = '\n\n'
body.append(div)
def a(anchor):
a = div.makeelement(
XHTML('a'), href='#' + anchor,
style='white-space: pre; min-width: 10px; min-height: 10px; border: solid 1px;'
style='min-width: 10px !important; min-height: 10px !important; border: solid 1px !important;'
)
a.text = a.tail = ' '
div.append(a)