Skip to content

Commit

Permalink
Merge pull request #17 from cscott/gh-16
Browse files Browse the repository at this point in the history
Only add newlines after <pre>/<textarea>/<listing> if necessary.
  • Loading branch information
fgnass committed Feb 17, 2013
2 parents 67f5ad0 + 78233b1 commit 18f5de9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions lib/Node.js
Original file line number Diff line number Diff line change
Expand Up @@ -543,9 +543,10 @@ Node.prototype = Object.create(EventTarget.prototype, {
s += '>';

if (!(html && emptyElements[tagname])) {
if (html && extraNewLine[tagname]) s += '\n';
var ss = kid.serialize();
if (html && extraNewLine[tagname] && ss.charAt(0)==='\n') s += '\n';
// Serialize children and add end tag for all others
s += kid.serialize();
s += ss;
s += '</' + tagname + '>';
}
break;
Expand Down

0 comments on commit 18f5de9

Please sign in to comment.