mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Discard trailing () of ref automatically
This commit is contained in:
parent
60d0f43a62
commit
ee3a9492a1
@ -345,7 +345,9 @@ class FFMLProcessor:
|
|||||||
result += '\n'
|
result += '\n'
|
||||||
result += '\n'
|
result += '\n'
|
||||||
elif tree.node_kind() == NodeKinds.REF:
|
elif tree.node_kind() == NodeKinds.REF:
|
||||||
result += f':ref:`{tree.text()}() <ff_{tree.text()}>`'
|
if (rname := tree.text()).endswith('()'):
|
||||||
|
rname = rname[:-2]
|
||||||
|
result += f':ref:`{rname}() <ff_{rname}>`'
|
||||||
elif tree.node_kind() == NodeKinds.TEXT:
|
elif tree.node_kind() == NodeKinds.TEXT:
|
||||||
txt = tree.text()
|
txt = tree.text()
|
||||||
if not result:
|
if not result:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user