From 8614e1ae09be35af8f878d70f01470a045eebf02 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 30 Oct 2019 18:19:25 -0700 Subject: [PATCH] Handle and tags in the docs xml --- etgtools/sphinx_generator.py | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/etgtools/sphinx_generator.py b/etgtools/sphinx_generator.py index 8e4cdfc7..79b101e6 100644 --- a/etgtools/sphinx_generator.py +++ b/etgtools/sphinx_generator.py @@ -1915,6 +1915,27 @@ class ULink(Node): return text +# ----------------------------------------------------------------------- # + +class DashBase(Node): + dash_text = '-' + + def Join(self, with_tail=True): + text = self.dash_text + if self.element.text: + text += self.element.text + if with_tail and self.element.tail: + text += convertToPython(self.element.tail) + return text + + +class EnDash(DashBase): + dash_text = u'\u2013' + +class EmDash(DashBase): + dash_text = u'\u2014' + + # ----------------------------------------------------------------------- # class XMLDocString(object): @@ -2217,6 +2238,11 @@ class XMLDocString(object): self.root.AddSection(section) rest_class = parent + elif tag == 'ndash': + rest_class = EnDash(element, parent) + elif tag == 'mdash': + rest_class = EmDash(element, parent) + else: rest_class = Node('', parent)