diff options
| author | Michael Williamson <mike@zwobble.org> | 2014-04-10 14:28:13 +0100 |
|---|---|---|
| committer | Michael Williamson <mike@zwobble.org> | 2014-04-10 14:28:13 +0100 |
| commit | 91eb47cc9c8b82bc171f818046c8100e3420a2b2 (patch) | |
| tree | 61254ae4e6a2f9e9b749cf1c9474971592f3c26c /lib | |
| parent | 8fcdf02810e5880fe58d1308c80142cbc936c9e3 (diff) | |
Indent self-closing elements
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/html-writer.js | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/lib/html-writer.js b/lib/html-writer.js index 1b551ed..be35d52 100644 --- a/lib/html-writer.js +++ b/lib/html-writer.js @@ -52,6 +52,11 @@ function prettyWriter() { writer.text(value.replace("\n", "\n" + indentation)); } + function selfClosing(tagName, attributes) { + indent(); + writer.selfClosing(tagName, attributes); + } + function insideIndentedElement() { return stack.length === 0 || indentedElements[stack[stack.length - 1]]; } @@ -70,7 +75,7 @@ function prettyWriter() { open: open, close: close, text: text, - selfClosing: writer.selfClosing, + selfClosing: selfClosing, append: writer.append }; } |
