64 |
64 |
65 return string.rep(" ", ind)..s_format(use_tag_format, t.name, attr_string, children_text, t.name); |
65 return string.rep(" ", ind)..s_format(use_tag_format, t.name, attr_string, children_text, t.name); |
66 end |
66 end |
67 |
67 |
68 return function (s, ind) |
68 return function (s, ind) |
69 local doc = assert(xml.parse(s)); |
69 local doc = xml.parse(s); |
|
70 if not doc then |
|
71 return s; -- Not valid XML, don't prettify |
|
72 end |
70 return pretty_print(doc, ind); |
73 return pretty_print(doc, ind); |
71 end |
74 end |
72 end |
75 end |
73 |
76 |
74 return { |
77 return { |