]> granicus.if.org Git - python/commitdiff
convert(): Add support for ESIS '&' lines, and make sure we don't
authorFred Drake <fdrake@acm.org>
Thu, 26 Aug 1999 17:50:26 +0000 (17:50 +0000)
committerFred Drake <fdrake@acm.org>
Thu, 26 Aug 1999 17:50:26 +0000 (17:50 +0000)
            silently ignore unrecognized lines.

Doc/tools/sgmlconv/esis2sgml.py

index 38866cec217a07ad3d1ed8c4f6b06008855de395..adb887312a0790e8af3e637f1f8d3d3095551159 100755 (executable)
@@ -146,6 +146,11 @@ def convert(ifp, ofp, xml=0, autoclose=(), verbatims=()):
             attrs[name] = esistools.decode(value)
         elif type == "e":
             knownempty = 1
+        elif type == "&":
+            ofp.write("&%s;" % data)
+            knownempty = 0
+        else:
+            raise RuntimeError, "unrecognized ESIS event type: '%s'" % type
 
     if LIST_EMPTIES:
         dump_empty_element_names(knownempties)