This commit is contained in:
Kovid Goyal 2019-11-03 14:59:11 +05:30
parent 580d0e2ba7
commit b21132b428
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -406,12 +406,17 @@ def create_margin_files(container):
# Link handling {{{ # Link handling {{{
def add_anchors_markup(root, uuid, anchors): def add_anchors_markup(root, uuid, anchors):
body = last_tag(root) body = last_tag(root)
div = body.makeelement(XHTML('div'), id=uuid, style='display:block; page-break-before: always; break-before: always') div = body.makeelement(
XHTML('div'), id=uuid,
style='display:block; page-break-before: always; break-before: always;'
)
body.append(div) body.append(div)
def a(anchor): def a(anchor):
a = div.makeelement( a = div.makeelement(
XHTML('a'), href='#' + anchor, style='white-space: pre; min-width: 10px; min-height: 10px; border: solid 1px') XHTML('a'), href='#' + anchor,
style='white-space: pre; min-width: 10px; min-height: 10px; border: solid 1px;'
)
a.text = a.tail = ' ' a.text = a.tail = ' '
div.append(a) div.append(a)
tuple(map(a, anchors)) tuple(map(a, anchors))