File tree 2 files changed +10
-1
lines changed 2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ class SaveOptions
34
34
DEFAULT_HTML = FORMAT | NO_DECLARATION | NO_EMPTY_TAGS | AS_HTML
35
35
end
36
36
# the default for XHTML document
37
- DEFAULT_XHTML = FORMAT | NO_DECLARATION | NO_EMPTY_TAGS | AS_XHTML
37
+ DEFAULT_XHTML = FORMAT | NO_DECLARATION | AS_XHTML
38
38
39
39
# Integer representation of the SaveOptions
40
40
attr_reader :options
Original file line number Diff line number Diff line change @@ -370,6 +370,15 @@ def test_to_xhtml
370
370
assert_match ( "UTF-8" , html . to_xhtml ( encoding : "UTF-8" ) )
371
371
end
372
372
373
+ def test_to_xhtml_self_closing_tags
374
+ # https://github.com/sparklemotion/nokogiri/issues/2324
375
+ html = "<html><body><br><table><colgroup><col>"
376
+ doc = Nokogiri ::HTML ::Document . parse ( html )
377
+ xhtml = doc . to_xhtml
378
+ assert_match ( %r(<br ?/>) , xhtml )
379
+ assert_match ( %r(<col ?/>) , xhtml )
380
+ end
381
+
373
382
def test_no_xml_header
374
383
html = Nokogiri ::HTML ( <<~EOHTML )
375
384
< html >
You can’t perform that action at this time.
0 commit comments