@@ -15,6 +15,7 @@ import {one} from './tree.js'
1515 * @param {Options } [options]
1616 * @returns {string }
1717 */
18+ // eslint-disable-next-line complexity
1819export function toHtml ( node , options = { } ) {
1920 const quote = options . quote || '"'
2021 /** @type {Quote } */
@@ -32,20 +33,20 @@ export function toHtml(node, options = {}) {
3233 omit : options . omitOptionalTags ? omission : undefined ,
3334 quote,
3435 alternative,
35- smart : options . quoteSmart ,
36- unquoted : options . preferUnquoted ,
37- tight : options . tightAttributes ,
38- upperDoctype : options . upperDoctype ,
39- tightDoctype : options . tightDoctype ,
40- bogusComments : options . bogusComments ,
41- tightLists : options . tightCommaSeparatedLists ,
42- tightClose : options . tightSelfClosing ,
43- collapseEmpty : options . collapseEmptyAttributes ,
44- dangerous : options . allowDangerousHtml ,
36+ smart : options . quoteSmart || false ,
37+ unquoted : options . preferUnquoted || false ,
38+ tight : options . tightAttributes || false ,
39+ upperDoctype : options . upperDoctype || false ,
40+ tightDoctype : options . tightDoctype || false ,
41+ bogusComments : options . bogusComments || false ,
42+ tightLists : options . tightCommaSeparatedLists || false ,
43+ tightClose : options . tightSelfClosing || false ,
44+ collapseEmpty : options . collapseEmptyAttributes || false ,
45+ dangerous : options . allowDangerousHtml || false ,
4546 voids : options . voids || htmlVoidElements . concat ( ) ,
4647 entities : options . entities || { } ,
47- close : options . closeSelfClosing ,
48- closeEmpty : options . closeEmptyElements
48+ close : options . closeSelfClosing || false ,
49+ closeEmpty : options . closeEmptyElements || false
4950 }
5051
5152 return one (
0 commit comments