mirror of
https://github.com/python/cpython.git
synced 2025-07-24 03:35:53 +00:00
convert(): Add support for ESIS '&' lines, and make sure we don't
silently ignore unrecognized lines.
This commit is contained in:
parent
762e206706
commit
53eae8e81b
1 changed files with 5 additions and 0 deletions
|
@ -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)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue