Merge pull request #1423 from wxWidgets/handle-dash-tags

Handle <ndash> and <mdash> tags in the docs xml
This commit is contained in:
Robin Dunn
2019-10-30 19:33:06 -07:00
committed by GitHub

View File

@@ -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)