mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-05 11:30:06 +01:00
Merge pull request #1423 from wxWidgets/handle-dash-tags
Handle <ndash> and <mdash> tags in the docs xml
This commit is contained in:
@@ -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)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user