Improve pretty-printing for text-only nodes
This commit is contained in:
parent
b738939001
commit
06eb95d9c1
1 changed files with 4 additions and 0 deletions
|
@ -34,6 +34,10 @@ local function write_elem(tree, indent)
|
|||
return out .. '/>'
|
||||
end
|
||||
out = out .. '>'
|
||||
-- Never indent the content if it's purely text.
|
||||
if #tree == 1 and type(tree[1]) == 'string' then
|
||||
indent = nil
|
||||
end
|
||||
local inner_indent = indent and indent .. ' '
|
||||
local is_string
|
||||
for _, elem in ipairs(tree) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue