Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit f6199ed

Browse files
committed
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.
1 parent a20581c commit f6199ed

1 file changed

Lines changed: 7 additions & 0 deletions

File tree

Doc/tools/sgmlconv/latex2esis.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,8 @@ def subconvert(self, endchar=None, depth=0):
266266
self.write("(%s\n" % entry.outputname)
267267
self.err_write("--- text: %s\n" % `pentry.text`)
268268
self.write("-%s\n" % encode(pentry.text))
269+
elif pentry.type == "entityref":
270+
self.write("&%s\n" % pentry.name)
269271
if entry.outputname:
270272
if not opened:
271273
self.write("(%s\n" % entry.outputname)
@@ -460,6 +462,11 @@ def start_attribute(self, attrs):
460462
def end_attribute(self):
461463
self.__current.parameters[-1].text = self.__buffer
462464

465+
def start_entityref(self, attrs):
466+
name = attrs["name"]
467+
p = Parameter("entityref", name)
468+
self.__current.parameters.append(p)
469+
463470
def start_child(self, attrs):
464471
name = attrs["name"]
465472
p = Parameter("child", name, attrs.get("optional") == "yes")

0 commit comments

Comments
 (0)