node_modules/mdsvex/dist/main.es.js
// Encode special characters in `value`.
Encode special characters in `value`.
Encode special characters in ` value ` .
function encode(value, options) {
  var settings = options || {};
  var subset = settings.subset;
  var set = subset ? toExpression(subset) : defaultEscapes;
  var escapeOnly = settings.escapeOnly;
  var omit = settings.omitOptionalSemicolons;
  value = value.replace(set, replace);
  if (subset || escapeOnly) {
    return value
  }
  return value
    .replace(surrogatePair, replaceSurrogatePair)
    .replace(bmp, replace)
  function replaceSurrogatePair(pair, pos, val) {
    return toHexReference(
      (pair.charCodeAt(0) - 0xd800) * 0x400 +
        pair.charCodeAt(1) -
        0xdc00 +
        0x10000,
      val.charAt(pos + 2),
      omit
    )
  }
  function replace(char, pos, val) {
    return one$1(char, val.charAt(pos + 1), settings)
  }
}
function encode ( value , options ) { var settings = options || { } ; var subset = settings . subset ; var set = subset ? toExpression ( subset ) : defaultEscapes ; var escapeOnly = settings . escapeOnly ; var omit = settings . omitOptionalSemicolons ; value = value . replace ( set , replace ) ; if ( subset || escapeOnly ) { return value } return value . replace ( surrogatePair , replaceSurrogatePair ) . replace ( bmp , replace ) function replaceSurrogatePair ( pair , pos , val ) { return toHexReference ( ( pair . charCodeAt ( 0 ) - 0xd800 ) * 0x400 + pair . charCodeAt ( 1 ) - 0xdc00 + 0x10000 , val . charAt ( pos + 2 ) , omit ) } function replace ( char , pos , val ) { return one$1 ( char , val . charAt ( pos + 1 ) , settings ) } }
Encode special characters in `value`.
Encode special characters in ` value ` .