mirror of
https://github.com/python/cpython.git
synced 2025-08-03 16:39:00 +00:00
Conversion.subconvert(): Added support for "entityref" parameters
(must be named in the conversion spec.). TableParser.start_entityref(): New method. Use to support creating entity references via the conversion specification.
This commit is contained in:
parent
a20581c1e5
commit
f6199edcd3
1 changed files with 7 additions and 0 deletions
|
@ -266,6 +266,8 @@ class Conversion:
|
|||
self.write("(%s\n" % entry.outputname)
|
||||
self.err_write("--- text: %s\n" % `pentry.text`)
|
||||
self.write("-%s\n" % encode(pentry.text))
|
||||
elif pentry.type == "entityref":
|
||||
self.write("&%s\n" % pentry.name)
|
||||
if entry.outputname:
|
||||
if not opened:
|
||||
self.write("(%s\n" % entry.outputname)
|
||||
|
@ -460,6 +462,11 @@ class TableParser(XMLParser):
|
|||
def end_attribute(self):
|
||||
self.__current.parameters[-1].text = self.__buffer
|
||||
|
||||
def start_entityref(self, attrs):
|
||||
name = attrs["name"]
|
||||
p = Parameter("entityref", name)
|
||||
self.__current.parameters.append(p)
|
||||
|
||||
def start_child(self, attrs):
|
||||
name = attrs["name"]
|
||||
p = Parameter("child", name, attrs.get("optional") == "yes")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue