Skip to content

Commit

Permalink
Merge pull request #250 from lake-of-fire/master
Browse files Browse the repository at this point in the history
selfclosing for html too
  • Loading branch information
scinfu authored Jan 5, 2024
2 parents cb96568 + d7aaff2 commit 63d6f01
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions Sources/Element.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1226,9 +1226,9 @@ open class Element: Node {
// selfclosing includes unknown tags, isEmpty defines tags that are always empty
if (childNodes.isEmpty && _tag.isSelfClosing()) {
if (out.syntax() == OutputSettings.Syntax.html && _tag.isEmpty()) {
accum.append(">")
accum.append(" />") // <img /> for "always empty" tags. selfclosing is ignored but retained for xml/xhtml compatibility
} else {
accum.append(" />") // <img> in html, <img /> in xml
accum.append(" />") // <img /> in xml
}
} else {
accum.append(">")
Expand Down

0 comments on commit 63d6f01

Please sign in to comment.