From 1d3ddf3ac37ef2f2f877ba23d756894a2b4aaf20 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Kv=C3=A5l?= Date: Sun, 29 Dec 2024 23:48:21 +0000 Subject: [PATCH] text: do not render internal links in text mode Avoids useless: ... (#target) ... in text mode --- xml2rfc/writers/text.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/xml2rfc/writers/text.py b/xml2rfc/writers/text.py index 94a3b7fb..70b91d25 100644 --- a/xml2rfc/writers/text.py +++ b/xml2rfc/writers/text.py @@ -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: