File: /www/wwwroot/www.waciwang.com/wp-content/plugins/gutenberg/build/scripts/escape-html/index.js.map
{
"version": 3,
"sources": ["../../../packages/escape-html/src/escape-greater.ts", "../../../packages/escape-html/src/index.ts"],
"sourcesContent": ["/**\n * Returns a string with greater-than sign replaced.\n *\n * Note that if a resolution for Trac#45387 comes to fruition, it is no longer\n * necessary for `__unstableEscapeGreaterThan` to exist.\n *\n * See: https://core.trac.wordpress.org/ticket/45387\n *\n * @param value Original string.\n *\n * @return Escaped string.\n */\nexport default function __unstableEscapeGreaterThan( value: string ): string {\n\treturn value.replace( />/g, '>' );\n}\n", "/**\n * Internal dependencies\n */\nimport __unstableEscapeGreaterThan from './escape-greater';\n\n/**\n * Regular expression matching invalid attribute names.\n *\n * \"Attribute names must consist of one or more characters other than controls,\n * U+0020 SPACE, U+0022 (\"), U+0027 ('), U+003E (>), U+002F (/), U+003D (=),\n * and noncharacters.\"\n *\n * @see https://html.spec.whatwg.org/multipage/syntax.html#attributes-2\n */\nconst REGEXP_INVALID_ATTRIBUTE_NAME: RegExp =\n\t/[\\u007F-\\u009F \"'>/=\"\\uFDD0-\\uFDEF]/;\n\n/**\n * Returns a string with ampersands escaped. Note that this is an imperfect\n * implementation, where only ampersands which do not appear as a pattern of\n * named, decimal, or hexadecimal character references are escaped. Invalid\n * named references (i.e. ambiguous ampersand) are still permitted.\n *\n * @see https://w3c.github.io/html/syntax.html#character-references\n * @see https://w3c.github.io/html/syntax.html#ambiguous-ampersand\n * @see https://w3c.github.io/html/syntax.html#named-character-references\n *\n * @param value Original string.\n *\n * @return Escaped string.\n */\nexport function escapeAmpersand( value: string ): string {\n\treturn value.replace( /&(?!([a-z0-9]+|#[0-9]+|#x[a-f0-9]+);)/gi, '&' );\n}\n\n/**\n * Returns a string with quotation marks replaced.\n *\n * @param value Original string.\n *\n * @return Escaped string.\n */\nexport function escapeQuotationMark( value: string ): string {\n\treturn value.replace( /\"/g, '"' );\n}\n\n/**\n * Returns a string with less-than sign replaced.\n *\n * @param value Original string.\n *\n * @return Escaped string.\n */\nexport function escapeLessThan( value: string ): string {\n\treturn value.replace( /</g, '<' );\n}\n\n/**\n * Returns an escaped attribute value.\n *\n * @see https://w3c.github.io/html/syntax.html#elements-attributes\n *\n * \"[...] the text cannot contain an ambiguous ampersand [...] must not contain\n * any literal U+0022 QUOTATION MARK characters (\")\"\n *\n * Note we also escape the greater than symbol, as this is used by wptexturize to\n * split HTML strings. This is a WordPress specific fix\n *\n * Note that if a resolution for Trac#45387 comes to fruition, it is no longer\n * necessary for `__unstableEscapeGreaterThan` to be used.\n *\n * See: https://core.trac.wordpress.org/ticket/45387\n *\n * @param value Attribute value.\n *\n * @return Escaped attribute value.\n */\nexport function escapeAttribute( value: string ): string {\n\treturn __unstableEscapeGreaterThan(\n\t\tescapeQuotationMark( escapeAmpersand( value ) )\n\t);\n}\n\n/**\n * Returns an escaped HTML element value.\n *\n * @see https://w3c.github.io/html/syntax.html#writing-html-documents-elements\n *\n * \"the text must not contain the character U+003C LESS-THAN SIGN (<) or an\n * ambiguous ampersand.\"\n *\n * @param value Element value.\n *\n * @return Escaped HTML element value.\n */\nexport function escapeHTML( value: string ): string {\n\treturn escapeLessThan( escapeAmpersand( value ) );\n}\n\n/**\n * Returns an escaped Editable HTML element value. This is different from\n * `escapeHTML`, because for editable HTML, ALL ampersands must be escaped in\n * order to render the content correctly on the page.\n *\n * @param value Element value.\n *\n * @return Escaped HTML element value.\n */\nexport function escapeEditableHTML( value: string ): string {\n\treturn escapeLessThan( value.replace( /&/g, '&' ) );\n}\n\n/**\n * Returns true if the given attribute name is valid, or false otherwise.\n *\n * @param name Attribute name to test.\n *\n * @return Whether attribute is valid.\n */\nexport function isValidAttributeName( name: string ): boolean {\n\treturn ! REGEXP_INVALID_ATTRIBUTE_NAME.test( name );\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYe,WAAR,4BAA8C,OAAwB;AAC5E,WAAO,MAAM,QAAS,MAAM,MAAO;EACpC;;;ACAA,MAAM,gCACL;AAgBM,WAAS,gBAAiB,OAAwB;AACxD,WAAO,MAAM,QAAS,2CAA2C,OAAQ;EAC1E;AASO,WAAS,oBAAqB,OAAwB;AAC5D,WAAO,MAAM,QAAS,MAAM,QAAS;EACtC;AASO,WAAS,eAAgB,OAAwB;AACvD,WAAO,MAAM,QAAS,MAAM,MAAO;EACpC;AAsBO,WAAS,gBAAiB,OAAwB;AACxD,WAAO;MACN,oBAAqB,gBAAiB,KAAM,CAAE;IAC/C;EACD;AAcO,WAAS,WAAY,OAAwB;AACnD,WAAO,eAAgB,gBAAiB,KAAM,CAAE;EACjD;AAWO,WAAS,mBAAoB,OAAwB;AAC3D,WAAO,eAAgB,MAAM,QAAS,MAAM,OAAQ,CAAE;EACvD;AASO,WAAS,qBAAsB,MAAwB;AAC7D,WAAO,CAAE,8BAA8B,KAAM,IAAK;EACnD;",
"names": []
}