Skip to content

Commit

Permalink
Also limit XML line length in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
jmccrae committed Jan 1, 2024
1 parent bc18c0b commit d5cc2b0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion dmlex-v1.0/specification/examples/examples/build_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@
with open(f) as inf:
with open(f + ".xml", "w") as outf:
outf.write("<programlisting>\n")
outf.write(inf.read().replace("<", "&lt;").replace(">", "&gt;"))
for line in inf.readlines():
while len(line) > N:
outf.write(line[:N].replace("<", "&lt;").replace(">", "&gt;"))
outf.write("\n")
line = line[N:]
outf.write(line.replace("<", "&lt;").replace(">", "&gt;"))
outf.write("</programlisting>\n")

for f in glob("source/*.rdf"):
Expand Down

0 comments on commit d5cc2b0

Please sign in to comment.