Skip to content

Commit

Permalink
text: do not render internal links in text mode
Browse files Browse the repository at this point in the history
Avoids useless: ... (#target) ...
in text mode
  • Loading branch information
d-javu authored Dec 29, 2024
1 parent 924f192 commit 1d3ddf3
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion xml2rfc/writers/text.py
Original file line number Diff line number Diff line change
Expand Up @@ -1648,7 +1648,10 @@ def render_eref(self, e, width, **kwargs):
self.warn(e, "Expected the 'target' attribute to have a value, but found %s" % (etree.tostring(e), ))
if brackets == 'none':
if e.text and target:
target = "(%s)" % target
if target[0] == '#':
target = ""
else:
target = "(%s)" % target
elif brackets == 'angle':
target = "<%s>" % target
else:
Expand Down

0 comments on commit 1d3ddf3

Please sign in to comment.