node_modules/hast-util-to-html/lib/index.js
/* Stringify the given HAST node. */
Stringify the given HAST node.
Stringify the given HAST node .
function toHTML(node, options) {
  var settings = options || {};
  var quote = settings.quote || DQ;
  var smart = settings.quoteSmart;
  var errors = settings.allowParseErrors;
  var characters = settings.allowDangerousCharacters;
  var alternative = quote === DQ ? SQ : DQ;
  var name = errors ? NAME : CLEAN_NAME;
  var unquoted = errors ? UQ_VALUE : UQ_VALUE_CLEAN;
  var singleQuoted = errors ? SQ_VALUE : SQ_VALUE_CLEAN;
  var doubleQuoted = errors ? DQ_VALUE : DQ_VALUE_CLEAN;
  if (quote !== DQ && quote !== SQ) {
    throw new Error(
      'Invalid quote `' + quote + '`, expected `' +
      SQ + '` or `' + DQ + '`'
    );
  }
  return one({
    NAME: name.concat(characters ? [] : QUOTES),
    UNQUOTED: unquoted.concat(characters ? [] : QUOTES),
    DOUBLE_QUOTED: doubleQuoted.concat(characters ? [] : QUOTES),
    SINGLE_QUOTED: singleQuoted.concat(characters ? [] : QUOTES),
    omit: settings.omitOptionalTags && omission,
    quote: quote,
    alternative: smart ? alternative : null,
    unquoted: Boolean(settings.preferUnquoted),
    tight: settings.tightAttributes,
    tightLists: settings.tightCommaSeparatedLists,
    tightClose: settings.tightSelfClosing,
    collapseEmpty: settings.collapseEmptyAttributes,
    dangerous: settings.allowDangerousHTML,
    voids: settings.voids || voids.concat(),
    entities: settings.entities || {},
    close: settings.closeSelfClosing
  }, node);
}
function toHTML ( node , options ) { var settings = options || { } ; var quote = settings . quote || DQ ; var smart = settings . quoteSmart ; var errors = settings . allowParseErrors ; var characters = settings . allowDangerousCharacters ; var alternative = quote === DQ ? SQ : DQ ; var name = errors ? NAME : CLEAN_NAME ; var unquoted = errors ? UQ_VALUE : UQ_VALUE_CLEAN ; var singleQuoted = errors ? SQ_VALUE : SQ_VALUE_CLEAN ; var doubleQuoted = errors ? DQ_VALUE : DQ_VALUE_CLEAN ; if ( quote !== DQ && quote !== SQ ) { throw new Error ( 'Invalid quote `' + quote + '`, expected `' + SQ + '` or `' + DQ + '`' ) ; } return one ( { NAME : name . concat ( characters ? [ ] : QUOTES ) , UNQUOTED : unquoted . concat ( characters ? [ ] : QUOTES ) , DOUBLE_QUOTED : doubleQuoted . concat ( characters ? [ ] : QUOTES ) , SINGLE_QUOTED : singleQuoted . concat ( characters ? [ ] : QUOTES ) , omit : settings . omitOptionalTags && omission , quote : quote , alternative : smart ? alternative : null , unquoted : Boolean ( settings . preferUnquoted ) , tight : settings . tightAttributes , tightLists : settings . tightCommaSeparatedLists , tightClose : settings . tightSelfClosing , collapseEmpty : settings . collapseEmptyAttributes , dangerous : settings . allowDangerousHTML , voids : settings . voids || voids . concat ( ) , entities : settings . entities || { } , close : settings . closeSelfClosing } , node ) ; }
Stringify the given HAST node.
Stringify the given HAST node .