@wordpress/autop 4.0.1 → 4.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +14 -6
- package/build/index.js +13 -16
- package/build/index.js.map +1 -1
- package/build-module/index.js +13 -16
- package/build-module/index.js.map +1 -1
- package/build-types/index.d.ts +8 -8
- package/build-types/index.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/{index.js → index.ts} +23 -23
- package/src/test/{index.test.js → index.test.ts} +6 -6
- package/tsconfig.tsbuildinfo +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
## 4.2.0 (2024-06-26)
|
|
6
|
+
|
|
7
|
+
## 4.1.0 (2024-06-15)
|
|
8
|
+
|
|
9
|
+
### Internal
|
|
10
|
+
|
|
11
|
+
- Refactor to TypeScript ([#62583](https://github.com/WordPress/gutenberg/pull/62583)).
|
|
12
|
+
|
|
5
13
|
## 4.0.0 (2024-05-31)
|
|
6
14
|
|
|
7
15
|
### Breaking Changes
|
|
@@ -135,31 +143,31 @@
|
|
|
135
143
|
|
|
136
144
|
## 2.7.0 (2020-04-15)
|
|
137
145
|
|
|
138
|
-
### New
|
|
146
|
+
### New Features
|
|
139
147
|
|
|
140
148
|
- Include TypeScript type declarations ([#20669](https://github.com/WordPress/gutenberg/pull/20669))
|
|
141
149
|
|
|
142
150
|
## 2.3.0 (2019-05-21)
|
|
143
151
|
|
|
144
|
-
### Bug
|
|
152
|
+
### Bug Fixes
|
|
145
153
|
|
|
146
154
|
- `removep` will correctly preserve multi-line paragraph tags where attributes are present.
|
|
147
155
|
|
|
148
156
|
## 2.1.0 (2019-03-06)
|
|
149
157
|
|
|
150
|
-
### Bug
|
|
158
|
+
### Bug Fixes
|
|
151
159
|
|
|
152
160
|
- `autop` correctly matches whitespace preceding and following block-level elements.
|
|
153
161
|
|
|
154
162
|
## 2.0.0 (2018-09-05)
|
|
155
163
|
|
|
156
|
-
### Breaking
|
|
164
|
+
### Breaking Changes
|
|
157
165
|
|
|
158
166
|
- Change how required built-ins are polyfilled with Babel 7 ([#9171](https://github.com/WordPress/gutenberg/pull/9171)). If you're using an environment that has limited or no support for ES2015+ such as lower versions of IE then using [core-js](https://github.com/zloirock/core-js) or [@babel/polyfill](https://babeljs.io/docs/en/next/babel-polyfill) will add support for these methods.
|
|
159
167
|
|
|
160
168
|
## 1.1.0 (2018-07-12)
|
|
161
169
|
|
|
162
|
-
### New
|
|
170
|
+
### New Features
|
|
163
171
|
|
|
164
172
|
- Updated build to work with Babel 7 ([#7832](https://github.com/WordPress/gutenberg/pull/7832))
|
|
165
173
|
|
|
@@ -169,6 +177,6 @@
|
|
|
169
177
|
|
|
170
178
|
## 1.0.6 (2018-05-08)
|
|
171
179
|
|
|
172
|
-
###
|
|
180
|
+
### Internal
|
|
173
181
|
|
|
174
182
|
- Documentation: Fix API method typo for `removep`. ([#120](https://github.com/WordPress/packages/pull/120))
|
package/build/index.js
CHANGED
|
@@ -7,8 +7,6 @@ exports.autop = autop;
|
|
|
7
7
|
exports.removep = removep;
|
|
8
8
|
/**
|
|
9
9
|
* The regular expression for an HTML element.
|
|
10
|
-
*
|
|
11
|
-
* @type {RegExp}
|
|
12
10
|
*/
|
|
13
11
|
const htmlSplitRegex = (() => {
|
|
14
12
|
/* eslint-disable no-multi-spaces */
|
|
@@ -63,9 +61,9 @@ const htmlSplitRegex = (() => {
|
|
|
63
61
|
/**
|
|
64
62
|
* Separate HTML elements and comments from the text.
|
|
65
63
|
*
|
|
66
|
-
* @param
|
|
64
|
+
* @param input The text which has to be formatted.
|
|
67
65
|
*
|
|
68
|
-
* @return
|
|
66
|
+
* @return The formatted text.
|
|
69
67
|
*/
|
|
70
68
|
function htmlSplit(input) {
|
|
71
69
|
const parts = [];
|
|
@@ -76,7 +74,7 @@ function htmlSplit(input) {
|
|
|
76
74
|
// If the `g` flag is omitted, `index` is included.
|
|
77
75
|
// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.
|
|
78
76
|
// Assert `match.index` is a number.
|
|
79
|
-
const index =
|
|
77
|
+
const index = match.index;
|
|
80
78
|
parts.push(workingInput.slice(0, index));
|
|
81
79
|
parts.push(match[0]);
|
|
82
80
|
workingInput = workingInput.slice(index + match[0].length);
|
|
@@ -90,10 +88,10 @@ function htmlSplit(input) {
|
|
|
90
88
|
/**
|
|
91
89
|
* Replace characters or phrases within HTML elements only.
|
|
92
90
|
*
|
|
93
|
-
* @param
|
|
94
|
-
* @param
|
|
91
|
+
* @param haystack The text which has to be formatted.
|
|
92
|
+
* @param replacePairs In the form {from: 'to', …}.
|
|
95
93
|
*
|
|
96
|
-
* @return
|
|
94
|
+
* @return The formatted text.
|
|
97
95
|
*/
|
|
98
96
|
function replaceInHtmlTags(haystack, replacePairs) {
|
|
99
97
|
// Find all elements.
|
|
@@ -128,9 +126,9 @@ function replaceInHtmlTags(haystack, replacePairs) {
|
|
|
128
126
|
* replace double line-breaks with HTML paragraph tags. The remaining line-
|
|
129
127
|
* breaks after conversion become `<br />` tags, unless br is set to 'false'.
|
|
130
128
|
*
|
|
131
|
-
* @param
|
|
132
|
-
* @param
|
|
133
|
-
*
|
|
129
|
+
* @param text The text which has to be formatted.
|
|
130
|
+
* @param br Optional. If set, will convert all remaining line-
|
|
131
|
+
* breaks after paragraphing. Default true.
|
|
134
132
|
*
|
|
135
133
|
* @example
|
|
136
134
|
*```js
|
|
@@ -138,7 +136,7 @@ function replaceInHtmlTags(haystack, replacePairs) {
|
|
|
138
136
|
* autop( 'my text' ); // "<p>my text</p>"
|
|
139
137
|
* ```
|
|
140
138
|
*
|
|
141
|
-
* @return
|
|
139
|
+
* @return Text which has been converted into paragraph tags.
|
|
142
140
|
*/
|
|
143
141
|
function autop(text, br = true) {
|
|
144
142
|
const preTags = [];
|
|
@@ -299,7 +297,7 @@ function autop(text, br = true) {
|
|
|
299
297
|
* Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.
|
|
300
298
|
* Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.
|
|
301
299
|
*
|
|
302
|
-
* @param
|
|
300
|
+
* @param html The content from the editor.
|
|
303
301
|
*
|
|
304
302
|
* @example
|
|
305
303
|
* ```js
|
|
@@ -307,13 +305,12 @@ function autop(text, br = true) {
|
|
|
307
305
|
* removep( '<p>my text</p>' ); // "my text"
|
|
308
306
|
* ```
|
|
309
307
|
*
|
|
310
|
-
* @return
|
|
308
|
+
* @return The content with stripped paragraph tags.
|
|
311
309
|
*/
|
|
312
310
|
function removep(html) {
|
|
313
311
|
const blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';
|
|
314
312
|
const blocklist1 = blocklist + '|div|p';
|
|
315
313
|
const blocklist2 = blocklist + '|pre';
|
|
316
|
-
/** @type {string[]} */
|
|
317
314
|
const preserve = [];
|
|
318
315
|
let preserveLinebreaks = false;
|
|
319
316
|
let preserveBr = false;
|
|
@@ -424,7 +421,7 @@ function removep(html) {
|
|
|
424
421
|
// Restore preserved tags.
|
|
425
422
|
if (preserve.length) {
|
|
426
423
|
html = html.replace(/<wp-preserve>/g, () => {
|
|
427
|
-
return
|
|
424
|
+
return preserve.shift();
|
|
428
425
|
});
|
|
429
426
|
}
|
|
430
427
|
return html;
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["htmlSplitRegex","comments","cdata","escaped","regex","RegExp","htmlSplit","input","parts","workingInput","match","index","push","slice","length","replaceInHtmlTags","haystack","replacePairs","textArr","changed","needles","Object","keys","i","j","needle","indexOf","replace","join","autop","text","br","preTags","trim","textParts","split","lastText","pop","textPart","start","name","substr","allBlocks","texts","filter","Boolean","forEach","textPiece","a","b","preTag","original","removep","html","blocklist","blocklist1","blocklist2","preserve","preserveLinebreaks","preserveBr","_","space","shift"],"sources":["@wordpress/autop/src/index.js"],"sourcesContent":["/**\n * The regular expression for an HTML element.\n *\n * @type {RegExp}\n */\nconst htmlSplitRegex = ( () => {\n\t/* eslint-disable no-multi-spaces */\n\tconst comments =\n\t\t'!' + // Start of comment, after the <.\n\t\t'(?:' + // Unroll the loop: Consume everything until --> is found.\n\t\t'-(?!->)' + // Dash not followed by end of comment.\n\t\t'[^\\\\-]*' + // Consume non-dashes.\n\t\t')*' + // Loop possessively.\n\t\t'(?:-->)?'; // End of comment. If not found, match all input.\n\n\tconst cdata =\n\t\t'!\\\\[CDATA\\\\[' + // Start of comment, after the <.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t'(?:' + // Unroll the loop: Consume everything until ]]> is found.\n\t\t'](?!]>)' + // One ] not followed by end of comment.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t')*?' + // Loop possessively.\n\t\t'(?:]]>)?'; // End of comment. If not found, match all input.\n\n\tconst escaped =\n\t\t'(?=' + // Is the element escaped?\n\t\t'!--' +\n\t\t'|' +\n\t\t'!\\\\[CDATA\\\\[' +\n\t\t')' +\n\t\t'((?=!-)' + // If yes, which type?\n\t\tcomments +\n\t\t'|' +\n\t\tcdata +\n\t\t')';\n\n\tconst regex =\n\t\t'(' + // Capture the entire match.\n\t\t'<' + // Find start of element.\n\t\t'(' + // Conditional expression follows.\n\t\tescaped + // Find end of escaped element.\n\t\t'|' + // ... else ...\n\t\t'[^>]*>?' + // Find end of normal element.\n\t\t')' +\n\t\t')';\n\n\treturn new RegExp( regex );\n\t/* eslint-enable no-multi-spaces */\n} )();\n\n/**\n * Separate HTML elements and comments from the text.\n *\n * @param {string} input The text which has to be formatted.\n *\n * @return {string[]} The formatted text.\n */\nfunction htmlSplit( input ) {\n\tconst parts = [];\n\tlet workingInput = input;\n\n\tlet match;\n\twhile ( ( match = workingInput.match( htmlSplitRegex ) ) ) {\n\t\t// The `match` result, when invoked on a RegExp with the `g` flag (`/foo/g`) will not include `index`.\n\t\t// If the `g` flag is omitted, `index` is included.\n\t\t// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.\n\t\t// Assert `match.index` is a number.\n\t\tconst index = /** @type {number} */ ( match.index );\n\n\t\tparts.push( workingInput.slice( 0, index ) );\n\t\tparts.push( match[ 0 ] );\n\t\tworkingInput = workingInput.slice( index + match[ 0 ].length );\n\t}\n\n\tif ( workingInput.length ) {\n\t\tparts.push( workingInput );\n\t}\n\n\treturn parts;\n}\n\n/**\n * Replace characters or phrases within HTML elements only.\n *\n * @param {string} haystack The text which has to be formatted.\n * @param {Record<string,string>} replacePairs In the form {from: 'to', …}.\n *\n * @return {string} The formatted text.\n */\nfunction replaceInHtmlTags( haystack, replacePairs ) {\n\t// Find all elements.\n\tconst textArr = htmlSplit( haystack );\n\tlet changed = false;\n\n\t// Extract all needles.\n\tconst needles = Object.keys( replacePairs );\n\n\t// Loop through delimiters (elements) only.\n\tfor ( let i = 1; i < textArr.length; i += 2 ) {\n\t\tfor ( let j = 0; j < needles.length; j++ ) {\n\t\t\tconst needle = needles[ j ];\n\t\t\tif ( -1 !== textArr[ i ].indexOf( needle ) ) {\n\t\t\t\ttextArr[ i ] = textArr[ i ].replace(\n\t\t\t\t\tnew RegExp( needle, 'g' ),\n\t\t\t\t\treplacePairs[ needle ]\n\t\t\t\t);\n\t\t\t\tchanged = true;\n\t\t\t\t// After one strtr() break out of the foreach loop and look at next element.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( changed ) {\n\t\thaystack = textArr.join( '' );\n\t}\n\n\treturn haystack;\n}\n\n/**\n * Replaces double line-breaks with paragraph elements.\n *\n * A group of regex replaces used to identify text formatted with newlines and\n * replace double line-breaks with HTML paragraph tags. The remaining line-\n * breaks after conversion become `<br />` tags, unless br is set to 'false'.\n *\n * @param {string} text The text which has to be formatted.\n * @param {boolean} br Optional. If set, will convert all remaining line-\n * breaks after paragraphing. Default true.\n *\n * @example\n *```js\n * import { autop } from '@wordpress/autop';\n * autop( 'my text' ); // \"<p>my text</p>\"\n * ```\n *\n * @return {string} Text which has been converted into paragraph tags.\n */\nexport function autop( text, br = true ) {\n\tconst preTags = [];\n\n\tif ( text.trim() === '' ) {\n\t\treturn '';\n\t}\n\n\t// Just to make things a little easier, pad the end.\n\ttext = text + '\\n';\n\n\t/*\n\t * Pre tags shouldn't be touched by autop.\n\t * Replace pre tags with placeholders and bring them back after autop.\n\t */\n\tif ( text.indexOf( '<pre' ) !== -1 ) {\n\t\tconst textParts = text.split( '</pre>' );\n\t\tconst lastText = textParts.pop();\n\t\ttext = '';\n\n\t\tfor ( let i = 0; i < textParts.length; i++ ) {\n\t\t\tconst textPart = textParts[ i ];\n\t\t\tconst start = textPart.indexOf( '<pre' );\n\n\t\t\t// Malformed html?\n\t\t\tif ( start === -1 ) {\n\t\t\t\ttext += textPart;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst name = '<pre wp-pre-tag-' + i + '></pre>';\n\t\t\tpreTags.push( [ name, textPart.substr( start ) + '</pre>' ] );\n\n\t\t\ttext += textPart.substr( 0, start ) + name;\n\t\t}\n\n\t\ttext += lastText;\n\t}\n\t// Change multiple <br>s into two line breaks, which will turn into paragraphs.\n\ttext = text.replace( /<br\\s*\\/?>\\s*<br\\s*\\/?>/g, '\\n\\n' );\n\n\tconst allBlocks =\n\t\t'(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';\n\n\t// Add a double line break above block-level opening tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(<' + allBlocks + '[\\\\s/>])', 'g' ),\n\t\t'\\n\\n$1'\n\t);\n\n\t// Add a double line break below block-level closing tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(</' + allBlocks + '>)', 'g' ),\n\t\t'$1\\n\\n'\n\t);\n\n\t// Standardize newline characters to \"\\n\".\n\ttext = text.replace( /\\r\\n|\\r/g, '\\n' );\n\n\t// Find newlines in all elements and add placeholders.\n\ttext = replaceInHtmlTags( text, { '\\n': ' <!-- wpnl --> ' } );\n\n\t// Collapse line breaks before and after <option> elements so they don't get autop'd.\n\tif ( text.indexOf( '<option' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*<option/g, '<option' );\n\t\ttext = text.replace( /<\\/option>\\s*/g, '</option>' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <object> elements, before <param> and <embed> elements\n\t * so they don't get autop'd.\n\t */\n\tif ( text.indexOf( '</object>' ) !== -1 ) {\n\t\ttext = text.replace( /(<object[^>]*>)\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*<\\/object>/g, '</object>' );\n\t\ttext = text.replace( /\\s*(<\\/?(?:param|embed)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <audio> and <video> elements,\n\t * before and after <source> and <track> elements.\n\t */\n\tif ( text.indexOf( '<source' ) !== -1 || text.indexOf( '<track' ) !== -1 ) {\n\t\ttext = text.replace( /([<\\[](?:audio|video)[^>\\]]*[>\\]])\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*([<\\[]\\/(?:audio|video)[>\\]])/g, '$1' );\n\t\ttext = text.replace( /\\s*(<(?:source|track)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t// Collapse line breaks before and after <figcaption> elements.\n\tif ( text.indexOf( '<figcaption' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*(<figcaption[^>]*>)/, '$1' );\n\t\ttext = text.replace( /<\\/figcaption>\\s*/, '</figcaption>' );\n\t}\n\n\t// Remove more than two contiguous line breaks.\n\ttext = text.replace( /\\n\\n+/g, '\\n\\n' );\n\n\t// Split up the contents into an array of strings, separated by double line breaks.\n\tconst texts = text.split( /\\n\\s*\\n/ ).filter( Boolean );\n\n\t// Reset text prior to rebuilding.\n\ttext = '';\n\n\t// Rebuild the content as a string, wrapping every bit with a <p>.\n\ttexts.forEach( ( textPiece ) => {\n\t\ttext += '<p>' + textPiece.replace( /^\\n*|\\n*$/g, '' ) + '</p>\\n';\n\t} );\n\n\t// Under certain strange conditions it could create a P of entirely whitespace.\n\ttext = text.replace( /<p>\\s*<\\/p>/g, '' );\n\n\t// Add a closing <p> inside <div>, <address>, or <form> tag if missing.\n\ttext = text.replace(\n\t\t/<p>([^<]+)<\\/(div|address|form)>/g,\n\t\t'<p>$1</p></$2>'\n\t);\n\n\t// If an opening or closing block element tag is wrapped in a <p>, unwrap it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// In some cases <li> may get wrapped in <p>, fix them.\n\ttext = text.replace( /<p>(<li.+?)<\\/p>/g, '$1' );\n\n\t// If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.\n\ttext = text.replace( /<p><blockquote([^>]*)>/gi, '<blockquote$1><p>' );\n\ttext = text.replace( /<\\/blockquote><\\/p>/g, '</p></blockquote>' );\n\n\t// If an opening or closing block element tag is preceded by an opening <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If an opening or closing block element tag is followed by a closing <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// Optionally insert line breaks.\n\tif ( br ) {\n\t\t// Replace newlines that shouldn't be touched with a placeholder.\n\t\ttext = text.replace( /<(script|style).*?<\\/\\\\1>/g, ( match ) =>\n\t\t\tmatch[ 0 ].replace( /\\n/g, '<WPPreserveNewline />' )\n\t\t);\n\n\t\t// Normalize <br>\n\t\ttext = text.replace( /<br>|<br\\/>/g, '<br />' );\n\n\t\t// Replace any new line characters that aren't preceded by a <br /> with a <br />.\n\t\ttext = text.replace( /(<br \\/>)?\\s*\\n/g, ( a, b ) =>\n\t\t\tb ? a : '<br />\\n'\n\t\t);\n\n\t\t// Replace newline placeholders with newlines.\n\t\ttext = text.replace( /<WPPreserveNewline \\/>/g, '\\n' );\n\t}\n\n\t// If a <br /> tag is after an opening or closing block tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*<br />', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If a <br /> tag is before a subset of opening or closing block tags, remove it.\n\ttext = text.replace(\n\t\t/<br \\/>(\\s*<\\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,\n\t\t'$1'\n\t);\n\ttext = text.replace( /\\n<\\/p>$/g, '</p>' );\n\n\t// Replace placeholder <pre> tags with their original content.\n\tpreTags.forEach( ( preTag ) => {\n\t\tconst [ name, original ] = preTag;\n\t\ttext = text.replace( name, original );\n\t} );\n\n\t// Restore newlines in all elements.\n\tif ( -1 !== text.indexOf( '<!-- wpnl -->' ) ) {\n\t\ttext = text.replace( /\\s?<!-- wpnl -->\\s?/g, '\\n' );\n\t}\n\n\treturn text;\n}\n\n/**\n * Replaces `<p>` tags with two line breaks. \"Opposite\" of autop().\n *\n * Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.\n * Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.\n *\n * @param {string} html The content from the editor.\n *\n * @example\n * ```js\n * import { removep } from '@wordpress/autop';\n * removep( '<p>my text</p>' ); // \"my text\"\n * ```\n *\n * @return {string} The content with stripped paragraph tags.\n */\nexport function removep( html ) {\n\tconst blocklist =\n\t\t'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';\n\tconst blocklist1 = blocklist + '|div|p';\n\tconst blocklist2 = blocklist + '|pre';\n\t/** @type {string[]} */\n\tconst preserve = [];\n\tlet preserveLinebreaks = false;\n\tlet preserveBr = false;\n\n\tif ( ! html ) {\n\t\treturn '';\n\t}\n\n\t// Protect script and style tags.\n\tif ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) {\n\t\thtml = html.replace(\n\t\t\t/<(script|style)[^>]*>[\\s\\S]*?<\\/\\1>/g,\n\t\t\t( match ) => {\n\t\t\t\tpreserve.push( match );\n\t\t\t\treturn '<wp-preserve>';\n\t\t\t}\n\t\t);\n\t}\n\n\t// Protect pre tags.\n\tif ( html.indexOf( '<pre' ) !== -1 ) {\n\t\tpreserveLinebreaks = true;\n\t\thtml = html.replace( /<pre[^>]*>[\\s\\S]+?<\\/pre>/g, ( a ) => {\n\t\t\ta = a.replace( /<br ?\\/?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\ta = a.replace( /<\\/?p( [^>]*)?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\treturn a.replace( /\\r?\\n/g, '<wp-line-break>' );\n\t\t} );\n\t}\n\n\t// Remove line breaks but keep <br> tags inside image captions.\n\tif ( html.indexOf( '[caption' ) !== -1 ) {\n\t\tpreserveBr = true;\n\t\thtml = html.replace( /\\[caption[\\s\\S]+?\\[\\/caption\\]/g, ( a ) => {\n\t\t\treturn a\n\t\t\t\t.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' )\n\t\t\t\t.replace( /[\\r\\n\\t]+/, '' );\n\t\t} );\n\t}\n\n\t// Normalize white space characters before and after block tags.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist1 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\n\t// Mark </p> if it has any attributes.\n\thtml = html.replace( /(<p [^>]+>[\\s\\S]*?)<\\/p>/g, '$1</p#>' );\n\n\t// Preserve the first <p> inside a <div>.\n\thtml = html.replace( /<div( [^>]*)?>\\s*<p>/gi, '<div$1>\\n\\n' );\n\n\t// Remove paragraph tags.\n\thtml = html.replace( /\\s*<p>/gi, '' );\n\thtml = html.replace( /\\s*<\\/p>\\s*/gi, '\\n\\n' );\n\n\t// Normalize white space chars and remove multiple line breaks.\n\thtml = html.replace( /\\n[\\s\\u00a0]+\\n/g, '\\n\\n' );\n\n\t// Replace <br> tags with line breaks.\n\thtml = html.replace( /(\\s*)<br ?\\/?>\\s*/gi, ( _, space ) => {\n\t\tif ( space && space.indexOf( '\\n' ) !== -1 ) {\n\t\t\treturn '\\n\\n';\n\t\t}\n\n\t\treturn '\\n';\n\t} );\n\n\t// Fix line breaks around <div>.\n\thtml = html.replace( /\\s*<div/g, '\\n<div' );\n\thtml = html.replace( /<\\/div>\\s*/g, '</div>\\n' );\n\n\t// Fix line breaks around caption shortcodes.\n\thtml = html.replace(\n\t\t/\\s*\\[caption([^\\[]+)\\[\\/caption\\]\\s*/gi,\n\t\t'\\n\\n[caption$1[/caption]\\n\\n'\n\t);\n\thtml = html.replace( /caption\\]\\n\\n+\\[caption/g, 'caption]\\n\\n[caption' );\n\n\t// Pad block elements tags with a line break.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\\\s*>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist2 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\n\t// Indent <li>, <dt> and <dd> tags.\n\thtml = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \\t<$1>' );\n\n\t// Fix line breaks around <select> and <option>.\n\tif ( html.indexOf( '<option' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<option/g, '\\n<option' );\n\t\thtml = html.replace( /\\s*<\\/select>/g, '\\n</select>' );\n\t}\n\n\t// Pad <hr> with two line breaks.\n\tif ( html.indexOf( '<hr' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<hr( [^>]*)?>\\s*/g, '\\n\\n<hr$1>\\n\\n' );\n\t}\n\n\t// Remove line breaks in <object> tags.\n\tif ( html.indexOf( '<object' ) !== -1 ) {\n\t\thtml = html.replace( /<object[\\s\\S]+?<\\/object>/g, ( a ) => {\n\t\t\treturn a.replace( /[\\r\\n]+/g, '' );\n\t\t} );\n\t}\n\n\t// Unmark special paragraph closing tags.\n\thtml = html.replace( /<\\/p#>/g, '</p>\\n' );\n\n\t// Pad remaining <p> tags whit a line break.\n\thtml = html.replace( /\\s*(<p [^>]+>[\\s\\S]*?<\\/p>)/g, '\\n$1' );\n\n\t// Trim.\n\thtml = html.replace( /^\\s+/, '' );\n\thtml = html.replace( /[\\s\\u00a0]+$/, '' );\n\n\tif ( preserveLinebreaks ) {\n\t\thtml = html.replace( /<wp-line-break>/g, '\\n' );\n\t}\n\n\tif ( preserveBr ) {\n\t\thtml = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );\n\t}\n\n\t// Restore preserved tags.\n\tif ( preserve.length ) {\n\t\thtml = html.replace( /<wp-preserve>/g, () => {\n\t\t\treturn /** @type {string} */ ( preserve.shift() );\n\t\t} );\n\t}\n\n\treturn html;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,CAAE,MAAM;EAC9B;EACA,MAAMC,QAAQ,GACb,GAAG;EAAG;EACN,KAAK;EAAG;EACR,SAAS;EAAG;EACZ,SAAS;EAAG;EACZ,IAAI;EAAG;EACP,UAAU,CAAC,CAAC;;EAEb,MAAMC,KAAK,GACV,cAAc;EAAG;EACjB,SAAS;EAAG;EACZ,KAAK;EAAG;EACR,SAAS;EAAG;EACZ,SAAS;EAAG;EACZ,KAAK;EAAG;EACR,UAAU,CAAC,CAAC;;EAEb,MAAMC,OAAO,GACZ,KAAK;EAAG;EACR,KAAK,GACL,GAAG,GACH,cAAc,GACd,GAAG,GACH,SAAS;EAAG;EACZF,QAAQ,GACR,GAAG,GACHC,KAAK,GACL,GAAG;EAEJ,MAAME,K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zBL,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,kBAAkB,EAAE,IAAK,CAAC;EAChD;EAEA,IAAKgC,UAAU,EAAG;IACjBN,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,sBAAsB,EAAE,QAAS,CAAC;EACxD;;EAEA;EACA,IAAK8B,QAAQ,CAAC3C,MAAM,EAAG;IACtBuC,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,gBAAgB,EAAE,MAAM;MAC5C,OAAO,qBAAwB8B,QAAQ,CAACK,KAAK,CAAC,CAAC;IAChD,CAAE,CAAC;EACJ;EAEA,OAAOT,IAAI;AACZ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["htmlSplitRegex","comments","cdata","escaped","regex","RegExp","htmlSplit","input","parts","workingInput","match","index","push","slice","length","replaceInHtmlTags","haystack","replacePairs","textArr","changed","needles","Object","keys","i","j","needle","indexOf","replace","join","autop","text","br","preTags","trim","textParts","split","lastText","pop","textPart","start","name","substr","allBlocks","texts","filter","Boolean","forEach","textPiece","a","b","preTag","original","removep","html","blocklist","blocklist1","blocklist2","preserve","preserveLinebreaks","preserveBr","_","space","shift"],"sources":["@wordpress/autop/src/index.ts"],"sourcesContent":["/**\n * The regular expression for an HTML element.\n */\nconst htmlSplitRegex: RegExp = ( () => {\n\t/* eslint-disable no-multi-spaces */\n\tconst comments =\n\t\t'!' + // Start of comment, after the <.\n\t\t'(?:' + // Unroll the loop: Consume everything until --> is found.\n\t\t'-(?!->)' + // Dash not followed by end of comment.\n\t\t'[^\\\\-]*' + // Consume non-dashes.\n\t\t')*' + // Loop possessively.\n\t\t'(?:-->)?'; // End of comment. If not found, match all input.\n\n\tconst cdata =\n\t\t'!\\\\[CDATA\\\\[' + // Start of comment, after the <.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t'(?:' + // Unroll the loop: Consume everything until ]]> is found.\n\t\t'](?!]>)' + // One ] not followed by end of comment.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t')*?' + // Loop possessively.\n\t\t'(?:]]>)?'; // End of comment. If not found, match all input.\n\n\tconst escaped =\n\t\t'(?=' + // Is the element escaped?\n\t\t'!--' +\n\t\t'|' +\n\t\t'!\\\\[CDATA\\\\[' +\n\t\t')' +\n\t\t'((?=!-)' + // If yes, which type?\n\t\tcomments +\n\t\t'|' +\n\t\tcdata +\n\t\t')';\n\n\tconst regex =\n\t\t'(' + // Capture the entire match.\n\t\t'<' + // Find start of element.\n\t\t'(' + // Conditional expression follows.\n\t\tescaped + // Find end of escaped element.\n\t\t'|' + // ... else ...\n\t\t'[^>]*>?' + // Find end of normal element.\n\t\t')' +\n\t\t')';\n\n\treturn new RegExp( regex );\n\t/* eslint-enable no-multi-spaces */\n} )();\n\n/**\n * Separate HTML elements and comments from the text.\n *\n * @param input The text which has to be formatted.\n *\n * @return The formatted text.\n */\nfunction htmlSplit( input: string ): string[] {\n\tconst parts = [];\n\tlet workingInput = input;\n\n\tlet match;\n\twhile ( ( match = workingInput.match( htmlSplitRegex ) ) ) {\n\t\t// The `match` result, when invoked on a RegExp with the `g` flag (`/foo/g`) will not include `index`.\n\t\t// If the `g` flag is omitted, `index` is included.\n\t\t// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.\n\t\t// Assert `match.index` is a number.\n\t\tconst index = match.index as number;\n\n\t\tparts.push( workingInput.slice( 0, index ) );\n\t\tparts.push( match[ 0 ] );\n\t\tworkingInput = workingInput.slice( index + match[ 0 ].length );\n\t}\n\n\tif ( workingInput.length ) {\n\t\tparts.push( workingInput );\n\t}\n\n\treturn parts;\n}\n\n/**\n * Replace characters or phrases within HTML elements only.\n *\n * @param haystack The text which has to be formatted.\n * @param replacePairs In the form {from: 'to', …}.\n *\n * @return The formatted text.\n */\nfunction replaceInHtmlTags(\n\thaystack: string,\n\treplacePairs: Record< string, string >\n): string {\n\t// Find all elements.\n\tconst textArr = htmlSplit( haystack );\n\tlet changed = false;\n\n\t// Extract all needles.\n\tconst needles = Object.keys( replacePairs );\n\n\t// Loop through delimiters (elements) only.\n\tfor ( let i = 1; i < textArr.length; i += 2 ) {\n\t\tfor ( let j = 0; j < needles.length; j++ ) {\n\t\t\tconst needle = needles[ j ];\n\t\t\tif ( -1 !== textArr[ i ].indexOf( needle ) ) {\n\t\t\t\ttextArr[ i ] = textArr[ i ].replace(\n\t\t\t\t\tnew RegExp( needle, 'g' ),\n\t\t\t\t\treplacePairs[ needle ]\n\t\t\t\t);\n\t\t\t\tchanged = true;\n\t\t\t\t// After one strtr() break out of the foreach loop and look at next element.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( changed ) {\n\t\thaystack = textArr.join( '' );\n\t}\n\n\treturn haystack;\n}\n\n/**\n * Replaces double line-breaks with paragraph elements.\n *\n * A group of regex replaces used to identify text formatted with newlines and\n * replace double line-breaks with HTML paragraph tags. The remaining line-\n * breaks after conversion become `<br />` tags, unless br is set to 'false'.\n *\n * @param text The text which has to be formatted.\n * @param br Optional. If set, will convert all remaining line-\n * breaks after paragraphing. Default true.\n *\n * @example\n *```js\n * import { autop } from '@wordpress/autop';\n * autop( 'my text' ); // \"<p>my text</p>\"\n * ```\n *\n * @return Text which has been converted into paragraph tags.\n */\nexport function autop( text: string, br: boolean = true ): string {\n\tconst preTags: Array< [ string, string ] > = [];\n\n\tif ( text.trim() === '' ) {\n\t\treturn '';\n\t}\n\n\t// Just to make things a little easier, pad the end.\n\ttext = text + '\\n';\n\n\t/*\n\t * Pre tags shouldn't be touched by autop.\n\t * Replace pre tags with placeholders and bring them back after autop.\n\t */\n\tif ( text.indexOf( '<pre' ) !== -1 ) {\n\t\tconst textParts = text.split( '</pre>' );\n\t\tconst lastText = textParts.pop();\n\t\ttext = '';\n\n\t\tfor ( let i = 0; i < textParts.length; i++ ) {\n\t\t\tconst textPart = textParts[ i ];\n\t\t\tconst start = textPart.indexOf( '<pre' );\n\n\t\t\t// Malformed html?\n\t\t\tif ( start === -1 ) {\n\t\t\t\ttext += textPart;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst name = '<pre wp-pre-tag-' + i + '></pre>';\n\t\t\tpreTags.push( [ name, textPart.substr( start ) + '</pre>' ] );\n\n\t\t\ttext += textPart.substr( 0, start ) + name;\n\t\t}\n\n\t\ttext += lastText;\n\t}\n\t// Change multiple <br>s into two line breaks, which will turn into paragraphs.\n\ttext = text.replace( /<br\\s*\\/?>\\s*<br\\s*\\/?>/g, '\\n\\n' );\n\n\tconst allBlocks =\n\t\t'(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';\n\n\t// Add a double line break above block-level opening tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(<' + allBlocks + '[\\\\s/>])', 'g' ),\n\t\t'\\n\\n$1'\n\t);\n\n\t// Add a double line break below block-level closing tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(</' + allBlocks + '>)', 'g' ),\n\t\t'$1\\n\\n'\n\t);\n\n\t// Standardize newline characters to \"\\n\".\n\ttext = text.replace( /\\r\\n|\\r/g, '\\n' );\n\n\t// Find newlines in all elements and add placeholders.\n\ttext = replaceInHtmlTags( text, { '\\n': ' <!-- wpnl --> ' } );\n\n\t// Collapse line breaks before and after <option> elements so they don't get autop'd.\n\tif ( text.indexOf( '<option' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*<option/g, '<option' );\n\t\ttext = text.replace( /<\\/option>\\s*/g, '</option>' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <object> elements, before <param> and <embed> elements\n\t * so they don't get autop'd.\n\t */\n\tif ( text.indexOf( '</object>' ) !== -1 ) {\n\t\ttext = text.replace( /(<object[^>]*>)\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*<\\/object>/g, '</object>' );\n\t\ttext = text.replace( /\\s*(<\\/?(?:param|embed)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <audio> and <video> elements,\n\t * before and after <source> and <track> elements.\n\t */\n\tif ( text.indexOf( '<source' ) !== -1 || text.indexOf( '<track' ) !== -1 ) {\n\t\ttext = text.replace( /([<\\[](?:audio|video)[^>\\]]*[>\\]])\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*([<\\[]\\/(?:audio|video)[>\\]])/g, '$1' );\n\t\ttext = text.replace( /\\s*(<(?:source|track)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t// Collapse line breaks before and after <figcaption> elements.\n\tif ( text.indexOf( '<figcaption' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*(<figcaption[^>]*>)/, '$1' );\n\t\ttext = text.replace( /<\\/figcaption>\\s*/, '</figcaption>' );\n\t}\n\n\t// Remove more than two contiguous line breaks.\n\ttext = text.replace( /\\n\\n+/g, '\\n\\n' );\n\n\t// Split up the contents into an array of strings, separated by double line breaks.\n\tconst texts = text.split( /\\n\\s*\\n/ ).filter( Boolean );\n\n\t// Reset text prior to rebuilding.\n\ttext = '';\n\n\t// Rebuild the content as a string, wrapping every bit with a <p>.\n\ttexts.forEach( ( textPiece ) => {\n\t\ttext += '<p>' + textPiece.replace( /^\\n*|\\n*$/g, '' ) + '</p>\\n';\n\t} );\n\n\t// Under certain strange conditions it could create a P of entirely whitespace.\n\ttext = text.replace( /<p>\\s*<\\/p>/g, '' );\n\n\t// Add a closing <p> inside <div>, <address>, or <form> tag if missing.\n\ttext = text.replace(\n\t\t/<p>([^<]+)<\\/(div|address|form)>/g,\n\t\t'<p>$1</p></$2>'\n\t);\n\n\t// If an opening or closing block element tag is wrapped in a <p>, unwrap it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// In some cases <li> may get wrapped in <p>, fix them.\n\ttext = text.replace( /<p>(<li.+?)<\\/p>/g, '$1' );\n\n\t// If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.\n\ttext = text.replace( /<p><blockquote([^>]*)>/gi, '<blockquote$1><p>' );\n\ttext = text.replace( /<\\/blockquote><\\/p>/g, '</p></blockquote>' );\n\n\t// If an opening or closing block element tag is preceded by an opening <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If an opening or closing block element tag is followed by a closing <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// Optionally insert line breaks.\n\tif ( br ) {\n\t\t// Replace newlines that shouldn't be touched with a placeholder.\n\t\ttext = text.replace( /<(script|style).*?<\\/\\\\1>/g, ( match ) =>\n\t\t\tmatch[ 0 ].replace( /\\n/g, '<WPPreserveNewline />' )\n\t\t);\n\n\t\t// Normalize <br>\n\t\ttext = text.replace( /<br>|<br\\/>/g, '<br />' );\n\n\t\t// Replace any new line characters that aren't preceded by a <br /> with a <br />.\n\t\ttext = text.replace( /(<br \\/>)?\\s*\\n/g, ( a, b ) =>\n\t\t\tb ? a : '<br />\\n'\n\t\t);\n\n\t\t// Replace newline placeholders with newlines.\n\t\ttext = text.replace( /<WPPreserveNewline \\/>/g, '\\n' );\n\t}\n\n\t// If a <br /> tag is after an opening or closing block tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*<br />', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If a <br /> tag is before a subset of opening or closing block tags, remove it.\n\ttext = text.replace(\n\t\t/<br \\/>(\\s*<\\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,\n\t\t'$1'\n\t);\n\ttext = text.replace( /\\n<\\/p>$/g, '</p>' );\n\n\t// Replace placeholder <pre> tags with their original content.\n\tpreTags.forEach( ( preTag ) => {\n\t\tconst [ name, original ] = preTag;\n\t\ttext = text.replace( name, original );\n\t} );\n\n\t// Restore newlines in all elements.\n\tif ( -1 !== text.indexOf( '<!-- wpnl -->' ) ) {\n\t\ttext = text.replace( /\\s?<!-- wpnl -->\\s?/g, '\\n' );\n\t}\n\n\treturn text;\n}\n\n/**\n * Replaces `<p>` tags with two line breaks. \"Opposite\" of autop().\n *\n * Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.\n * Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.\n *\n * @param html The content from the editor.\n *\n * @example\n * ```js\n * import { removep } from '@wordpress/autop';\n * removep( '<p>my text</p>' ); // \"my text\"\n * ```\n *\n * @return The content with stripped paragraph tags.\n */\nexport function removep( html: string ): string {\n\tconst blocklist =\n\t\t'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';\n\tconst blocklist1 = blocklist + '|div|p';\n\tconst blocklist2 = blocklist + '|pre';\n\tconst preserve: string[] = [];\n\tlet preserveLinebreaks = false;\n\tlet preserveBr = false;\n\n\tif ( ! html ) {\n\t\treturn '';\n\t}\n\n\t// Protect script and style tags.\n\tif ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) {\n\t\thtml = html.replace(\n\t\t\t/<(script|style)[^>]*>[\\s\\S]*?<\\/\\1>/g,\n\t\t\t( match ) => {\n\t\t\t\tpreserve.push( match );\n\t\t\t\treturn '<wp-preserve>';\n\t\t\t}\n\t\t);\n\t}\n\n\t// Protect pre tags.\n\tif ( html.indexOf( '<pre' ) !== -1 ) {\n\t\tpreserveLinebreaks = true;\n\t\thtml = html.replace( /<pre[^>]*>[\\s\\S]+?<\\/pre>/g, ( a ) => {\n\t\t\ta = a.replace( /<br ?\\/?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\ta = a.replace( /<\\/?p( [^>]*)?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\treturn a.replace( /\\r?\\n/g, '<wp-line-break>' );\n\t\t} );\n\t}\n\n\t// Remove line breaks but keep <br> tags inside image captions.\n\tif ( html.indexOf( '[caption' ) !== -1 ) {\n\t\tpreserveBr = true;\n\t\thtml = html.replace( /\\[caption[\\s\\S]+?\\[\\/caption\\]/g, ( a ) => {\n\t\t\treturn a\n\t\t\t\t.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' )\n\t\t\t\t.replace( /[\\r\\n\\t]+/, '' );\n\t\t} );\n\t}\n\n\t// Normalize white space characters before and after block tags.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist1 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\n\t// Mark </p> if it has any attributes.\n\thtml = html.replace( /(<p [^>]+>[\\s\\S]*?)<\\/p>/g, '$1</p#>' );\n\n\t// Preserve the first <p> inside a <div>.\n\thtml = html.replace( /<div( [^>]*)?>\\s*<p>/gi, '<div$1>\\n\\n' );\n\n\t// Remove paragraph tags.\n\thtml = html.replace( /\\s*<p>/gi, '' );\n\thtml = html.replace( /\\s*<\\/p>\\s*/gi, '\\n\\n' );\n\n\t// Normalize white space chars and remove multiple line breaks.\n\thtml = html.replace( /\\n[\\s\\u00a0]+\\n/g, '\\n\\n' );\n\n\t// Replace <br> tags with line breaks.\n\thtml = html.replace( /(\\s*)<br ?\\/?>\\s*/gi, ( _, space ) => {\n\t\tif ( space && space.indexOf( '\\n' ) !== -1 ) {\n\t\t\treturn '\\n\\n';\n\t\t}\n\n\t\treturn '\\n';\n\t} );\n\n\t// Fix line breaks around <div>.\n\thtml = html.replace( /\\s*<div/g, '\\n<div' );\n\thtml = html.replace( /<\\/div>\\s*/g, '</div>\\n' );\n\n\t// Fix line breaks around caption shortcodes.\n\thtml = html.replace(\n\t\t/\\s*\\[caption([^\\[]+)\\[\\/caption\\]\\s*/gi,\n\t\t'\\n\\n[caption$1[/caption]\\n\\n'\n\t);\n\thtml = html.replace( /caption\\]\\n\\n+\\[caption/g, 'caption]\\n\\n[caption' );\n\n\t// Pad block elements tags with a line break.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\\\s*>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist2 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\n\t// Indent <li>, <dt> and <dd> tags.\n\thtml = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \\t<$1>' );\n\n\t// Fix line breaks around <select> and <option>.\n\tif ( html.indexOf( '<option' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<option/g, '\\n<option' );\n\t\thtml = html.replace( /\\s*<\\/select>/g, '\\n</select>' );\n\t}\n\n\t// Pad <hr> with two line breaks.\n\tif ( html.indexOf( '<hr' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<hr( [^>]*)?>\\s*/g, '\\n\\n<hr$1>\\n\\n' );\n\t}\n\n\t// Remove line breaks in <object> tags.\n\tif ( html.indexOf( '<object' ) !== -1 ) {\n\t\thtml = html.replace( /<object[\\s\\S]+?<\\/object>/g, ( a ) => {\n\t\t\treturn a.replace( /[\\r\\n]+/g, '' );\n\t\t} );\n\t}\n\n\t// Unmark special paragraph closing tags.\n\thtml = html.replace( /<\\/p#>/g, '</p>\\n' );\n\n\t// Pad remaining <p> tags whit a line break.\n\thtml = html.replace( /\\s*(<p [^>]+>[\\s\\S]*?<\\/p>)/g, '\\n$1' );\n\n\t// Trim.\n\thtml = html.replace( /^\\s+/, '' );\n\thtml = html.replace( /[\\s\\u00a0]+$/, '' );\n\n\tif ( preserveLinebreaks ) {\n\t\thtml = html.replace( /<wp-line-break>/g, '\\n' );\n\t}\n\n\tif ( preserveBr ) {\n\t\thtml = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );\n\t}\n\n\t// Restore preserved tags.\n\tif ( preserve.length ) {\n\t\thtml = html.replace( /<wp-preserve>/g, () => {\n\t\t\treturn preserve.shift() as string;\n\t\t} );\n\t}\n\n\treturn html;\n}\n"],"mappings":";;;;;;;AAAA;AACA;AACA;AACA,MAAMA,cAAsB,GAAG,CAAE,MAAM;EACtC;EACA,MAAMC,QAAQ,GACb,GAAG;EAAG;EACN,KAAK;EAAG;EACR,SAAS;EAAG;EACZ,SAAS;EAAG;EACZ,IAAI;EAAG;EACP,UAAU,CAAC,CAAC;;EAEb,MAAMC,KAAK,GACV,cAAc;EAAG;EACjB,SAAS;EAAG;EACZ,KAAK;EAAG;EACR,SAAS;EAAG;EACZ,SAAS;EAAG;EACZ,KAAK;EAAG;EACR,UAAU,CAAC,CAAC;;EAEb,MAAMC,OAAO,GACZ,KAAK;EAAG;EACR,KAAK,GACL,GAAG,GACH,cAAc,GACd,GAAG,GACH,SAAS;EAAG;EACZF,QAAQ,GACR,GAAG,GACHC,KAAK,GACL,GAAG;EAEJ,MAAME,KAAK,GACV,GAAG;EAAG;EACN,GAAG;EAAG;EACN,GAAG;EAAG;EACND,OAAO;EAAG;EACV,GAAG;EAAG;EACN,SAAS;EAAG;EACZ,GAAG,GACH,GAAG;EAEJ,OAAO,IAAIE,MAAM,CAAED,KAAM,CAAC;EAC1B;AACD,CAAC,EAAG,CAAC;;AAEL;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAASE,SAASA,CAAEC,KAAa,EAAa;EAC7C,MAAMC,KAAK,GAAG,EAAE;EAChB,IAAIC,YAAY,GAAGF,KAAK;EAExB,IAAIG,KAAK;EACT,OAAUA,KAAK,GAAGD,YAAY,CAACC,KAAK,CAAEV,cAAe,CAAC,EAAK;IAC1D;IACA;IACA;IACA;IACA,MAAMW,KAAK,GAAGD,KAAK,CAACC,KAAe;IAEnCH,KAAK,CAACI,IAAI,CAAEH,YAAY,C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
3
|
*/
|
|
6
4
|
const htmlSplitRegex = (() => {
|
|
7
5
|
/* eslint-disable no-multi-spaces */
|
|
@@ -56,9 +54,9 @@ const htmlSplitRegex = (() => {
|
|
|
56
54
|
/**
|
|
57
55
|
* Separate HTML elements and comments from the text.
|
|
58
56
|
*
|
|
59
|
-
* @param
|
|
57
|
+
* @param input The text which has to be formatted.
|
|
60
58
|
*
|
|
61
|
-
* @return
|
|
59
|
+
* @return The formatted text.
|
|
62
60
|
*/
|
|
63
61
|
function htmlSplit(input) {
|
|
64
62
|
const parts = [];
|
|
@@ -69,7 +67,7 @@ function htmlSplit(input) {
|
|
|
69
67
|
// If the `g` flag is omitted, `index` is included.
|
|
70
68
|
// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.
|
|
71
69
|
// Assert `match.index` is a number.
|
|
72
|
-
const index =
|
|
70
|
+
const index = match.index;
|
|
73
71
|
parts.push(workingInput.slice(0, index));
|
|
74
72
|
parts.push(match[0]);
|
|
75
73
|
workingInput = workingInput.slice(index + match[0].length);
|
|
@@ -83,10 +81,10 @@ function htmlSplit(input) {
|
|
|
83
81
|
/**
|
|
84
82
|
* Replace characters or phrases within HTML elements only.
|
|
85
83
|
*
|
|
86
|
-
* @param
|
|
87
|
-
* @param
|
|
84
|
+
* @param haystack The text which has to be formatted.
|
|
85
|
+
* @param replacePairs In the form {from: 'to', …}.
|
|
88
86
|
*
|
|
89
|
-
* @return
|
|
87
|
+
* @return The formatted text.
|
|
90
88
|
*/
|
|
91
89
|
function replaceInHtmlTags(haystack, replacePairs) {
|
|
92
90
|
// Find all elements.
|
|
@@ -121,9 +119,9 @@ function replaceInHtmlTags(haystack, replacePairs) {
|
|
|
121
119
|
* replace double line-breaks with HTML paragraph tags. The remaining line-
|
|
122
120
|
* breaks after conversion become `<br />` tags, unless br is set to 'false'.
|
|
123
121
|
*
|
|
124
|
-
* @param
|
|
125
|
-
* @param
|
|
126
|
-
*
|
|
122
|
+
* @param text The text which has to be formatted.
|
|
123
|
+
* @param br Optional. If set, will convert all remaining line-
|
|
124
|
+
* breaks after paragraphing. Default true.
|
|
127
125
|
*
|
|
128
126
|
* @example
|
|
129
127
|
*```js
|
|
@@ -131,7 +129,7 @@ function replaceInHtmlTags(haystack, replacePairs) {
|
|
|
131
129
|
* autop( 'my text' ); // "<p>my text</p>"
|
|
132
130
|
* ```
|
|
133
131
|
*
|
|
134
|
-
* @return
|
|
132
|
+
* @return Text which has been converted into paragraph tags.
|
|
135
133
|
*/
|
|
136
134
|
export function autop(text, br = true) {
|
|
137
135
|
const preTags = [];
|
|
@@ -292,7 +290,7 @@ export function autop(text, br = true) {
|
|
|
292
290
|
* Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.
|
|
293
291
|
* Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.
|
|
294
292
|
*
|
|
295
|
-
* @param
|
|
293
|
+
* @param html The content from the editor.
|
|
296
294
|
*
|
|
297
295
|
* @example
|
|
298
296
|
* ```js
|
|
@@ -300,13 +298,12 @@ export function autop(text, br = true) {
|
|
|
300
298
|
* removep( '<p>my text</p>' ); // "my text"
|
|
301
299
|
* ```
|
|
302
300
|
*
|
|
303
|
-
* @return
|
|
301
|
+
* @return The content with stripped paragraph tags.
|
|
304
302
|
*/
|
|
305
303
|
export function removep(html) {
|
|
306
304
|
const blocklist = 'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';
|
|
307
305
|
const blocklist1 = blocklist + '|div|p';
|
|
308
306
|
const blocklist2 = blocklist + '|pre';
|
|
309
|
-
/** @type {string[]} */
|
|
310
307
|
const preserve = [];
|
|
311
308
|
let preserveLinebreaks = false;
|
|
312
309
|
let preserveBr = false;
|
|
@@ -417,7 +414,7 @@ export function removep(html) {
|
|
|
417
414
|
// Restore preserved tags.
|
|
418
415
|
if (preserve.length) {
|
|
419
416
|
html = html.replace(/<wp-preserve>/g, () => {
|
|
420
|
-
return
|
|
417
|
+
return preserve.shift();
|
|
421
418
|
});
|
|
422
419
|
}
|
|
423
420
|
return html;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["htmlSplitRegex","comments","cdata","escaped","regex","RegExp","htmlSplit","input","parts","workingInput","match","index","push","slice","length","replaceInHtmlTags","haystack","replacePairs","textArr","changed","needles","Object","keys","i","j","needle","indexOf","replace","join","autop","text","br","preTags","trim","textParts","split","lastText","pop","textPart","start","name","substr","allBlocks","texts","filter","Boolean","forEach","textPiece","a","b","preTag","original","removep","html","blocklist","blocklist1","blocklist2","preserve","preserveLinebreaks","preserveBr","_","space","shift"],"sources":["@wordpress/autop/src/index.js"],"sourcesContent":["/**\n * The regular expression for an HTML element.\n *\n * @type {RegExp}\n */\nconst htmlSplitRegex = ( () => {\n\t/* eslint-disable no-multi-spaces */\n\tconst comments =\n\t\t'!' + // Start of comment, after the <.\n\t\t'(?:' + // Unroll the loop: Consume everything until --> is found.\n\t\t'-(?!->)' + // Dash not followed by end of comment.\n\t\t'[^\\\\-]*' + // Consume non-dashes.\n\t\t')*' + // Loop possessively.\n\t\t'(?:-->)?'; // End of comment. If not found, match all input.\n\n\tconst cdata =\n\t\t'!\\\\[CDATA\\\\[' + // Start of comment, after the <.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t'(?:' + // Unroll the loop: Consume everything until ]]> is found.\n\t\t'](?!]>)' + // One ] not followed by end of comment.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t')*?' + // Loop possessively.\n\t\t'(?:]]>)?'; // End of comment. If not found, match all input.\n\n\tconst escaped =\n\t\t'(?=' + // Is the element escaped?\n\t\t'!--' +\n\t\t'|' +\n\t\t'!\\\\[CDATA\\\\[' +\n\t\t')' +\n\t\t'((?=!-)' + // If yes, which type?\n\t\tcomments +\n\t\t'|' +\n\t\tcdata +\n\t\t')';\n\n\tconst regex =\n\t\t'(' + // Capture the entire match.\n\t\t'<' + // Find start of element.\n\t\t'(' + // Conditional expression follows.\n\t\tescaped + // Find end of escaped element.\n\t\t'|' + // ... else ...\n\t\t'[^>]*>?' + // Find end of normal element.\n\t\t')' +\n\t\t')';\n\n\treturn new RegExp( regex );\n\t/* eslint-enable no-multi-spaces */\n} )();\n\n/**\n * Separate HTML elements and comments from the text.\n *\n * @param {string} input The text which has to be formatted.\n *\n * @return {string[]} The formatted text.\n */\nfunction htmlSplit( input ) {\n\tconst parts = [];\n\tlet workingInput = input;\n\n\tlet match;\n\twhile ( ( match = workingInput.match( htmlSplitRegex ) ) ) {\n\t\t// The `match` result, when invoked on a RegExp with the `g` flag (`/foo/g`) will not include `index`.\n\t\t// If the `g` flag is omitted, `index` is included.\n\t\t// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.\n\t\t// Assert `match.index` is a number.\n\t\tconst index = /** @type {number} */ ( match.index );\n\n\t\tparts.push( workingInput.slice( 0, index ) );\n\t\tparts.push( match[ 0 ] );\n\t\tworkingInput = workingInput.slice( index + match[ 0 ].length );\n\t}\n\n\tif ( workingInput.length ) {\n\t\tparts.push( workingInput );\n\t}\n\n\treturn parts;\n}\n\n/**\n * Replace characters or phrases within HTML elements only.\n *\n * @param {string} haystack The text which has to be formatted.\n * @param {Record<string,string>} replacePairs In the form {from: 'to', …}.\n *\n * @return {string} The formatted text.\n */\nfunction replaceInHtmlTags( haystack, replacePairs ) {\n\t// Find all elements.\n\tconst textArr = htmlSplit( haystack );\n\tlet changed = false;\n\n\t// Extract all needles.\n\tconst needles = Object.keys( replacePairs );\n\n\t// Loop through delimiters (elements) only.\n\tfor ( let i = 1; i < textArr.length; i += 2 ) {\n\t\tfor ( let j = 0; j < needles.length; j++ ) {\n\t\t\tconst needle = needles[ j ];\n\t\t\tif ( -1 !== textArr[ i ].indexOf( needle ) ) {\n\t\t\t\ttextArr[ i ] = textArr[ i ].replace(\n\t\t\t\t\tnew RegExp( needle, 'g' ),\n\t\t\t\t\treplacePairs[ needle ]\n\t\t\t\t);\n\t\t\t\tchanged = true;\n\t\t\t\t// After one strtr() break out of the foreach loop and look at next element.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( changed ) {\n\t\thaystack = textArr.join( '' );\n\t}\n\n\treturn haystack;\n}\n\n/**\n * Replaces double line-breaks with paragraph elements.\n *\n * A group of regex replaces used to identify text formatted with newlines and\n * replace double line-breaks with HTML paragraph tags. The remaining line-\n * breaks after conversion become `<br />` tags, unless br is set to 'false'.\n *\n * @param {string} text The text which has to be formatted.\n * @param {boolean} br Optional. If set, will convert all remaining line-\n * breaks after paragraphing. Default true.\n *\n * @example\n *```js\n * import { autop } from '@wordpress/autop';\n * autop( 'my text' ); // \"<p>my text</p>\"\n * ```\n *\n * @return {string} Text which has been converted into paragraph tags.\n */\nexport function autop( text, br = true ) {\n\tconst preTags = [];\n\n\tif ( text.trim() === '' ) {\n\t\treturn '';\n\t}\n\n\t// Just to make things a little easier, pad the end.\n\ttext = text + '\\n';\n\n\t/*\n\t * Pre tags shouldn't be touched by autop.\n\t * Replace pre tags with placeholders and bring them back after autop.\n\t */\n\tif ( text.indexOf( '<pre' ) !== -1 ) {\n\t\tconst textParts = text.split( '</pre>' );\n\t\tconst lastText = textParts.pop();\n\t\ttext = '';\n\n\t\tfor ( let i = 0; i < textParts.length; i++ ) {\n\t\t\tconst textPart = textParts[ i ];\n\t\t\tconst start = textPart.indexOf( '<pre' );\n\n\t\t\t// Malformed html?\n\t\t\tif ( start === -1 ) {\n\t\t\t\ttext += textPart;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst name = '<pre wp-pre-tag-' + i + '></pre>';\n\t\t\tpreTags.push( [ name, textPart.substr( start ) + '</pre>' ] );\n\n\t\t\ttext += textPart.substr( 0, start ) + name;\n\t\t}\n\n\t\ttext += lastText;\n\t}\n\t// Change multiple <br>s into two line breaks, which will turn into paragraphs.\n\ttext = text.replace( /<br\\s*\\/?>\\s*<br\\s*\\/?>/g, '\\n\\n' );\n\n\tconst allBlocks =\n\t\t'(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';\n\n\t// Add a double line break above block-level opening tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(<' + allBlocks + '[\\\\s/>])', 'g' ),\n\t\t'\\n\\n$1'\n\t);\n\n\t// Add a double line break below block-level closing tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(</' + allBlocks + '>)', 'g' ),\n\t\t'$1\\n\\n'\n\t);\n\n\t// Standardize newline characters to \"\\n\".\n\ttext = text.replace( /\\r\\n|\\r/g, '\\n' );\n\n\t// Find newlines in all elements and add placeholders.\n\ttext = replaceInHtmlTags( text, { '\\n': ' <!-- wpnl --> ' } );\n\n\t// Collapse line breaks before and after <option> elements so they don't get autop'd.\n\tif ( text.indexOf( '<option' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*<option/g, '<option' );\n\t\ttext = text.replace( /<\\/option>\\s*/g, '</option>' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <object> elements, before <param> and <embed> elements\n\t * so they don't get autop'd.\n\t */\n\tif ( text.indexOf( '</object>' ) !== -1 ) {\n\t\ttext = text.replace( /(<object[^>]*>)\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*<\\/object>/g, '</object>' );\n\t\ttext = text.replace( /\\s*(<\\/?(?:param|embed)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <audio> and <video> elements,\n\t * before and after <source> and <track> elements.\n\t */\n\tif ( text.indexOf( '<source' ) !== -1 || text.indexOf( '<track' ) !== -1 ) {\n\t\ttext = text.replace( /([<\\[](?:audio|video)[^>\\]]*[>\\]])\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*([<\\[]\\/(?:audio|video)[>\\]])/g, '$1' );\n\t\ttext = text.replace( /\\s*(<(?:source|track)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t// Collapse line breaks before and after <figcaption> elements.\n\tif ( text.indexOf( '<figcaption' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*(<figcaption[^>]*>)/, '$1' );\n\t\ttext = text.replace( /<\\/figcaption>\\s*/, '</figcaption>' );\n\t}\n\n\t// Remove more than two contiguous line breaks.\n\ttext = text.replace( /\\n\\n+/g, '\\n\\n' );\n\n\t// Split up the contents into an array of strings, separated by double line breaks.\n\tconst texts = text.split( /\\n\\s*\\n/ ).filter( Boolean );\n\n\t// Reset text prior to rebuilding.\n\ttext = '';\n\n\t// Rebuild the content as a string, wrapping every bit with a <p>.\n\ttexts.forEach( ( textPiece ) => {\n\t\ttext += '<p>' + textPiece.replace( /^\\n*|\\n*$/g, '' ) + '</p>\\n';\n\t} );\n\n\t// Under certain strange conditions it could create a P of entirely whitespace.\n\ttext = text.replace( /<p>\\s*<\\/p>/g, '' );\n\n\t// Add a closing <p> inside <div>, <address>, or <form> tag if missing.\n\ttext = text.replace(\n\t\t/<p>([^<]+)<\\/(div|address|form)>/g,\n\t\t'<p>$1</p></$2>'\n\t);\n\n\t// If an opening or closing block element tag is wrapped in a <p>, unwrap it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// In some cases <li> may get wrapped in <p>, fix them.\n\ttext = text.replace( /<p>(<li.+?)<\\/p>/g, '$1' );\n\n\t// If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.\n\ttext = text.replace( /<p><blockquote([^>]*)>/gi, '<blockquote$1><p>' );\n\ttext = text.replace( /<\\/blockquote><\\/p>/g, '</p></blockquote>' );\n\n\t// If an opening or closing block element tag is preceded by an opening <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If an opening or closing block element tag is followed by a closing <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// Optionally insert line breaks.\n\tif ( br ) {\n\t\t// Replace newlines that shouldn't be touched with a placeholder.\n\t\ttext = text.replace( /<(script|style).*?<\\/\\\\1>/g, ( match ) =>\n\t\t\tmatch[ 0 ].replace( /\\n/g, '<WPPreserveNewline />' )\n\t\t);\n\n\t\t// Normalize <br>\n\t\ttext = text.replace( /<br>|<br\\/>/g, '<br />' );\n\n\t\t// Replace any new line characters that aren't preceded by a <br /> with a <br />.\n\t\ttext = text.replace( /(<br \\/>)?\\s*\\n/g, ( a, b ) =>\n\t\t\tb ? a : '<br />\\n'\n\t\t);\n\n\t\t// Replace newline placeholders with newlines.\n\t\ttext = text.replace( /<WPPreserveNewline \\/>/g, '\\n' );\n\t}\n\n\t// If a <br /> tag is after an opening or closing block tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*<br />', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If a <br /> tag is before a subset of opening or closing block tags, remove it.\n\ttext = text.replace(\n\t\t/<br \\/>(\\s*<\\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,\n\t\t'$1'\n\t);\n\ttext = text.replace( /\\n<\\/p>$/g, '</p>' );\n\n\t// Replace placeholder <pre> tags with their original content.\n\tpreTags.forEach( ( preTag ) => {\n\t\tconst [ name, original ] = preTag;\n\t\ttext = text.replace( name, original );\n\t} );\n\n\t// Restore newlines in all elements.\n\tif ( -1 !== text.indexOf( '<!-- wpnl -->' ) ) {\n\t\ttext = text.replace( /\\s?<!-- wpnl -->\\s?/g, '\\n' );\n\t}\n\n\treturn text;\n}\n\n/**\n * Replaces `<p>` tags with two line breaks. \"Opposite\" of autop().\n *\n * Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.\n * Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.\n *\n * @param {string} html The content from the editor.\n *\n * @example\n * ```js\n * import { removep } from '@wordpress/autop';\n * removep( '<p>my text</p>' ); // \"my text\"\n * ```\n *\n * @return {string} The content with stripped paragraph tags.\n */\nexport function removep( html ) {\n\tconst blocklist =\n\t\t'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';\n\tconst blocklist1 = blocklist + '|div|p';\n\tconst blocklist2 = blocklist + '|pre';\n\t/** @type {string[]} */\n\tconst preserve = [];\n\tlet preserveLinebreaks = false;\n\tlet preserveBr = false;\n\n\tif ( ! html ) {\n\t\treturn '';\n\t}\n\n\t// Protect script and style tags.\n\tif ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) {\n\t\thtml = html.replace(\n\t\t\t/<(script|style)[^>]*>[\\s\\S]*?<\\/\\1>/g,\n\t\t\t( match ) => {\n\t\t\t\tpreserve.push( match );\n\t\t\t\treturn '<wp-preserve>';\n\t\t\t}\n\t\t);\n\t}\n\n\t// Protect pre tags.\n\tif ( html.indexOf( '<pre' ) !== -1 ) {\n\t\tpreserveLinebreaks = true;\n\t\thtml = html.replace( /<pre[^>]*>[\\s\\S]+?<\\/pre>/g, ( a ) => {\n\t\t\ta = a.replace( /<br ?\\/?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\ta = a.replace( /<\\/?p( [^>]*)?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\treturn a.replace( /\\r?\\n/g, '<wp-line-break>' );\n\t\t} );\n\t}\n\n\t// Remove line breaks but keep <br> tags inside image captions.\n\tif ( html.indexOf( '[caption' ) !== -1 ) {\n\t\tpreserveBr = true;\n\t\thtml = html.replace( /\\[caption[\\s\\S]+?\\[\\/caption\\]/g, ( a ) => {\n\t\t\treturn a\n\t\t\t\t.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' )\n\t\t\t\t.replace( /[\\r\\n\\t]+/, '' );\n\t\t} );\n\t}\n\n\t// Normalize white space characters before and after block tags.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist1 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\n\t// Mark </p> if it has any attributes.\n\thtml = html.replace( /(<p [^>]+>[\\s\\S]*?)<\\/p>/g, '$1</p#>' );\n\n\t// Preserve the first <p> inside a <div>.\n\thtml = html.replace( /<div( [^>]*)?>\\s*<p>/gi, '<div$1>\\n\\n' );\n\n\t// Remove paragraph tags.\n\thtml = html.replace( /\\s*<p>/gi, '' );\n\thtml = html.replace( /\\s*<\\/p>\\s*/gi, '\\n\\n' );\n\n\t// Normalize white space chars and remove multiple line breaks.\n\thtml = html.replace( /\\n[\\s\\u00a0]+\\n/g, '\\n\\n' );\n\n\t// Replace <br> tags with line breaks.\n\thtml = html.replace( /(\\s*)<br ?\\/?>\\s*/gi, ( _, space ) => {\n\t\tif ( space && space.indexOf( '\\n' ) !== -1 ) {\n\t\t\treturn '\\n\\n';\n\t\t}\n\n\t\treturn '\\n';\n\t} );\n\n\t// Fix line breaks around <div>.\n\thtml = html.replace( /\\s*<div/g, '\\n<div' );\n\thtml = html.replace( /<\\/div>\\s*/g, '</div>\\n' );\n\n\t// Fix line breaks around caption shortcodes.\n\thtml = html.replace(\n\t\t/\\s*\\[caption([^\\[]+)\\[\\/caption\\]\\s*/gi,\n\t\t'\\n\\n[caption$1[/caption]\\n\\n'\n\t);\n\thtml = html.replace( /caption\\]\\n\\n+\\[caption/g, 'caption]\\n\\n[caption' );\n\n\t// Pad block elements tags with a line break.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\\\s*>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist2 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\n\t// Indent <li>, <dt> and <dd> tags.\n\thtml = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \\t<$1>' );\n\n\t// Fix line breaks around <select> and <option>.\n\tif ( html.indexOf( '<option' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<option/g, '\\n<option' );\n\t\thtml = html.replace( /\\s*<\\/select>/g, '\\n</select>' );\n\t}\n\n\t// Pad <hr> with two line breaks.\n\tif ( html.indexOf( '<hr' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<hr( [^>]*)?>\\s*/g, '\\n\\n<hr$1>\\n\\n' );\n\t}\n\n\t// Remove line breaks in <object> tags.\n\tif ( html.indexOf( '<object' ) !== -1 ) {\n\t\thtml = html.replace( /<object[\\s\\S]+?<\\/object>/g, ( a ) => {\n\t\t\treturn a.replace( /[\\r\\n]+/g, '' );\n\t\t} );\n\t}\n\n\t// Unmark special paragraph closing tags.\n\thtml = html.replace( /<\\/p#>/g, '</p>\\n' );\n\n\t// Pad remaining <p> tags whit a line break.\n\thtml = html.replace( /\\s*(<p [^>]+>[\\s\\S]*?<\\/p>)/g, '\\n$1' );\n\n\t// Trim.\n\thtml = html.replace( /^\\s+/, '' );\n\thtml = html.replace( /[\\s\\u00a0]+$/, '' );\n\n\tif ( preserveLinebreaks ) {\n\t\thtml = html.replace( /<wp-line-break>/g, '\\n' );\n\t}\n\n\tif ( preserveBr ) {\n\t\thtml = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );\n\t}\n\n\t// Restore preserved tags.\n\tif ( preserve.length ) {\n\t\thtml = html.replace( /<wp-preserve>/g, () => {\n\t\t\treturn /** @type {string} */ ( preserve.shift() );\n\t\t} );\n\t}\n\n\treturn html;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA;AACA;AACA,MAAMA,cAAc,GAAG,CAAE,MAAM;EAC9B;EACA,MAAMC,QAAQ,GACb,GAAG;EAAG;EACN,KAAK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OAAO,CAAE,UAAU,EAAE,EAAG,CAAC;IACnC,CAAE,CAAC;EACJ;;EAEA;EACA0B,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,SAAS,EAAE,QAAS,CAAC;;EAE1C;EACA0B,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,8BAA8B,EAAE,MAAO,CAAC;;EAE7D;EACA0B,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,MAAM,EAAE,EAAG,CAAC;EACjC0B,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,cAAc,EAAE,EAAG,CAAC;EAEzC,IAAK+B,kBAAkB,EAAG;IACzBL,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,kBAAkB,EAAE,IAAK,CAAC;EAChD;EAEA,IAAKgC,UAAU,EAAG;IACjBN,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,sBAAsB,EAAE,QAAS,CAAC;EACxD;;EAEA;EACA,IAAK8B,QAAQ,CAAC3C,MAAM,EAAG;IACtBuC,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,gBAAgB,EAAE,MAAM;MAC5C,OAAO,qBAAwB8B,QAAQ,CAACK,KAAK,CAAC,CAAC;IAChD,CAAE,CAAC;EACJ;EAEA,OAAOT,IAAI;AACZ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["htmlSplitRegex","comments","cdata","escaped","regex","RegExp","htmlSplit","input","parts","workingInput","match","index","push","slice","length","replaceInHtmlTags","haystack","replacePairs","textArr","changed","needles","Object","keys","i","j","needle","indexOf","replace","join","autop","text","br","preTags","trim","textParts","split","lastText","pop","textPart","start","name","substr","allBlocks","texts","filter","Boolean","forEach","textPiece","a","b","preTag","original","removep","html","blocklist","blocklist1","blocklist2","preserve","preserveLinebreaks","preserveBr","_","space","shift"],"sources":["@wordpress/autop/src/index.ts"],"sourcesContent":["/**\n * The regular expression for an HTML element.\n */\nconst htmlSplitRegex: RegExp = ( () => {\n\t/* eslint-disable no-multi-spaces */\n\tconst comments =\n\t\t'!' + // Start of comment, after the <.\n\t\t'(?:' + // Unroll the loop: Consume everything until --> is found.\n\t\t'-(?!->)' + // Dash not followed by end of comment.\n\t\t'[^\\\\-]*' + // Consume non-dashes.\n\t\t')*' + // Loop possessively.\n\t\t'(?:-->)?'; // End of comment. If not found, match all input.\n\n\tconst cdata =\n\t\t'!\\\\[CDATA\\\\[' + // Start of comment, after the <.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t'(?:' + // Unroll the loop: Consume everything until ]]> is found.\n\t\t'](?!]>)' + // One ] not followed by end of comment.\n\t\t'[^\\\\]]*' + // Consume non-].\n\t\t')*?' + // Loop possessively.\n\t\t'(?:]]>)?'; // End of comment. If not found, match all input.\n\n\tconst escaped =\n\t\t'(?=' + // Is the element escaped?\n\t\t'!--' +\n\t\t'|' +\n\t\t'!\\\\[CDATA\\\\[' +\n\t\t')' +\n\t\t'((?=!-)' + // If yes, which type?\n\t\tcomments +\n\t\t'|' +\n\t\tcdata +\n\t\t')';\n\n\tconst regex =\n\t\t'(' + // Capture the entire match.\n\t\t'<' + // Find start of element.\n\t\t'(' + // Conditional expression follows.\n\t\tescaped + // Find end of escaped element.\n\t\t'|' + // ... else ...\n\t\t'[^>]*>?' + // Find end of normal element.\n\t\t')' +\n\t\t')';\n\n\treturn new RegExp( regex );\n\t/* eslint-enable no-multi-spaces */\n} )();\n\n/**\n * Separate HTML elements and comments from the text.\n *\n * @param input The text which has to be formatted.\n *\n * @return The formatted text.\n */\nfunction htmlSplit( input: string ): string[] {\n\tconst parts = [];\n\tlet workingInput = input;\n\n\tlet match;\n\twhile ( ( match = workingInput.match( htmlSplitRegex ) ) ) {\n\t\t// The `match` result, when invoked on a RegExp with the `g` flag (`/foo/g`) will not include `index`.\n\t\t// If the `g` flag is omitted, `index` is included.\n\t\t// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.\n\t\t// Assert `match.index` is a number.\n\t\tconst index = match.index as number;\n\n\t\tparts.push( workingInput.slice( 0, index ) );\n\t\tparts.push( match[ 0 ] );\n\t\tworkingInput = workingInput.slice( index + match[ 0 ].length );\n\t}\n\n\tif ( workingInput.length ) {\n\t\tparts.push( workingInput );\n\t}\n\n\treturn parts;\n}\n\n/**\n * Replace characters or phrases within HTML elements only.\n *\n * @param haystack The text which has to be formatted.\n * @param replacePairs In the form {from: 'to', …}.\n *\n * @return The formatted text.\n */\nfunction replaceInHtmlTags(\n\thaystack: string,\n\treplacePairs: Record< string, string >\n): string {\n\t// Find all elements.\n\tconst textArr = htmlSplit( haystack );\n\tlet changed = false;\n\n\t// Extract all needles.\n\tconst needles = Object.keys( replacePairs );\n\n\t// Loop through delimiters (elements) only.\n\tfor ( let i = 1; i < textArr.length; i += 2 ) {\n\t\tfor ( let j = 0; j < needles.length; j++ ) {\n\t\t\tconst needle = needles[ j ];\n\t\t\tif ( -1 !== textArr[ i ].indexOf( needle ) ) {\n\t\t\t\ttextArr[ i ] = textArr[ i ].replace(\n\t\t\t\t\tnew RegExp( needle, 'g' ),\n\t\t\t\t\treplacePairs[ needle ]\n\t\t\t\t);\n\t\t\t\tchanged = true;\n\t\t\t\t// After one strtr() break out of the foreach loop and look at next element.\n\t\t\t\tbreak;\n\t\t\t}\n\t\t}\n\t}\n\n\tif ( changed ) {\n\t\thaystack = textArr.join( '' );\n\t}\n\n\treturn haystack;\n}\n\n/**\n * Replaces double line-breaks with paragraph elements.\n *\n * A group of regex replaces used to identify text formatted with newlines and\n * replace double line-breaks with HTML paragraph tags. The remaining line-\n * breaks after conversion become `<br />` tags, unless br is set to 'false'.\n *\n * @param text The text which has to be formatted.\n * @param br Optional. If set, will convert all remaining line-\n * breaks after paragraphing. Default true.\n *\n * @example\n *```js\n * import { autop } from '@wordpress/autop';\n * autop( 'my text' ); // \"<p>my text</p>\"\n * ```\n *\n * @return Text which has been converted into paragraph tags.\n */\nexport function autop( text: string, br: boolean = true ): string {\n\tconst preTags: Array< [ string, string ] > = [];\n\n\tif ( text.trim() === '' ) {\n\t\treturn '';\n\t}\n\n\t// Just to make things a little easier, pad the end.\n\ttext = text + '\\n';\n\n\t/*\n\t * Pre tags shouldn't be touched by autop.\n\t * Replace pre tags with placeholders and bring them back after autop.\n\t */\n\tif ( text.indexOf( '<pre' ) !== -1 ) {\n\t\tconst textParts = text.split( '</pre>' );\n\t\tconst lastText = textParts.pop();\n\t\ttext = '';\n\n\t\tfor ( let i = 0; i < textParts.length; i++ ) {\n\t\t\tconst textPart = textParts[ i ];\n\t\t\tconst start = textPart.indexOf( '<pre' );\n\n\t\t\t// Malformed html?\n\t\t\tif ( start === -1 ) {\n\t\t\t\ttext += textPart;\n\t\t\t\tcontinue;\n\t\t\t}\n\n\t\t\tconst name = '<pre wp-pre-tag-' + i + '></pre>';\n\t\t\tpreTags.push( [ name, textPart.substr( start ) + '</pre>' ] );\n\n\t\t\ttext += textPart.substr( 0, start ) + name;\n\t\t}\n\n\t\ttext += lastText;\n\t}\n\t// Change multiple <br>s into two line breaks, which will turn into paragraphs.\n\ttext = text.replace( /<br\\s*\\/?>\\s*<br\\s*\\/?>/g, '\\n\\n' );\n\n\tconst allBlocks =\n\t\t'(?:table|thead|tfoot|caption|col|colgroup|tbody|tr|td|th|div|dl|dd|dt|ul|ol|li|pre|form|map|area|blockquote|address|math|style|p|h[1-6]|hr|fieldset|legend|section|article|aside|hgroup|header|footer|nav|figure|figcaption|details|menu|summary)';\n\n\t// Add a double line break above block-level opening tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(<' + allBlocks + '[\\\\s/>])', 'g' ),\n\t\t'\\n\\n$1'\n\t);\n\n\t// Add a double line break below block-level closing tags.\n\ttext = text.replace(\n\t\tnew RegExp( '(</' + allBlocks + '>)', 'g' ),\n\t\t'$1\\n\\n'\n\t);\n\n\t// Standardize newline characters to \"\\n\".\n\ttext = text.replace( /\\r\\n|\\r/g, '\\n' );\n\n\t// Find newlines in all elements and add placeholders.\n\ttext = replaceInHtmlTags( text, { '\\n': ' <!-- wpnl --> ' } );\n\n\t// Collapse line breaks before and after <option> elements so they don't get autop'd.\n\tif ( text.indexOf( '<option' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*<option/g, '<option' );\n\t\ttext = text.replace( /<\\/option>\\s*/g, '</option>' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <object> elements, before <param> and <embed> elements\n\t * so they don't get autop'd.\n\t */\n\tif ( text.indexOf( '</object>' ) !== -1 ) {\n\t\ttext = text.replace( /(<object[^>]*>)\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*<\\/object>/g, '</object>' );\n\t\ttext = text.replace( /\\s*(<\\/?(?:param|embed)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t/*\n\t * Collapse line breaks inside <audio> and <video> elements,\n\t * before and after <source> and <track> elements.\n\t */\n\tif ( text.indexOf( '<source' ) !== -1 || text.indexOf( '<track' ) !== -1 ) {\n\t\ttext = text.replace( /([<\\[](?:audio|video)[^>\\]]*[>\\]])\\s*/g, '$1' );\n\t\ttext = text.replace( /\\s*([<\\[]\\/(?:audio|video)[>\\]])/g, '$1' );\n\t\ttext = text.replace( /\\s*(<(?:source|track)[^>]*>)\\s*/g, '$1' );\n\t}\n\n\t// Collapse line breaks before and after <figcaption> elements.\n\tif ( text.indexOf( '<figcaption' ) !== -1 ) {\n\t\ttext = text.replace( /\\s*(<figcaption[^>]*>)/, '$1' );\n\t\ttext = text.replace( /<\\/figcaption>\\s*/, '</figcaption>' );\n\t}\n\n\t// Remove more than two contiguous line breaks.\n\ttext = text.replace( /\\n\\n+/g, '\\n\\n' );\n\n\t// Split up the contents into an array of strings, separated by double line breaks.\n\tconst texts = text.split( /\\n\\s*\\n/ ).filter( Boolean );\n\n\t// Reset text prior to rebuilding.\n\ttext = '';\n\n\t// Rebuild the content as a string, wrapping every bit with a <p>.\n\ttexts.forEach( ( textPiece ) => {\n\t\ttext += '<p>' + textPiece.replace( /^\\n*|\\n*$/g, '' ) + '</p>\\n';\n\t} );\n\n\t// Under certain strange conditions it could create a P of entirely whitespace.\n\ttext = text.replace( /<p>\\s*<\\/p>/g, '' );\n\n\t// Add a closing <p> inside <div>, <address>, or <form> tag if missing.\n\ttext = text.replace(\n\t\t/<p>([^<]+)<\\/(div|address|form)>/g,\n\t\t'<p>$1</p></$2>'\n\t);\n\n\t// If an opening or closing block element tag is wrapped in a <p>, unwrap it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// In some cases <li> may get wrapped in <p>, fix them.\n\ttext = text.replace( /<p>(<li.+?)<\\/p>/g, '$1' );\n\n\t// If a <blockquote> is wrapped with a <p>, move it inside the <blockquote>.\n\ttext = text.replace( /<p><blockquote([^>]*)>/gi, '<blockquote$1><p>' );\n\ttext = text.replace( /<\\/blockquote><\\/p>/g, '</p></blockquote>' );\n\n\t// If an opening or closing block element tag is preceded by an opening <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '<p>\\\\s*(</?' + allBlocks + '[^>]*>)', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If an opening or closing block element tag is followed by a closing <p> tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*</p>', 'g' ),\n\t\t'$1'\n\t);\n\n\t// Optionally insert line breaks.\n\tif ( br ) {\n\t\t// Replace newlines that shouldn't be touched with a placeholder.\n\t\ttext = text.replace( /<(script|style).*?<\\/\\\\1>/g, ( match ) =>\n\t\t\tmatch[ 0 ].replace( /\\n/g, '<WPPreserveNewline />' )\n\t\t);\n\n\t\t// Normalize <br>\n\t\ttext = text.replace( /<br>|<br\\/>/g, '<br />' );\n\n\t\t// Replace any new line characters that aren't preceded by a <br /> with a <br />.\n\t\ttext = text.replace( /(<br \\/>)?\\s*\\n/g, ( a, b ) =>\n\t\t\tb ? a : '<br />\\n'\n\t\t);\n\n\t\t// Replace newline placeholders with newlines.\n\t\ttext = text.replace( /<WPPreserveNewline \\/>/g, '\\n' );\n\t}\n\n\t// If a <br /> tag is after an opening or closing block tag, remove it.\n\ttext = text.replace(\n\t\tnew RegExp( '(</?' + allBlocks + '[^>]*>)\\\\s*<br />', 'g' ),\n\t\t'$1'\n\t);\n\n\t// If a <br /> tag is before a subset of opening or closing block tags, remove it.\n\ttext = text.replace(\n\t\t/<br \\/>(\\s*<\\/?(?:p|li|div|dl|dd|dt|th|pre|td|ul|ol)[^>]*>)/g,\n\t\t'$1'\n\t);\n\ttext = text.replace( /\\n<\\/p>$/g, '</p>' );\n\n\t// Replace placeholder <pre> tags with their original content.\n\tpreTags.forEach( ( preTag ) => {\n\t\tconst [ name, original ] = preTag;\n\t\ttext = text.replace( name, original );\n\t} );\n\n\t// Restore newlines in all elements.\n\tif ( -1 !== text.indexOf( '<!-- wpnl -->' ) ) {\n\t\ttext = text.replace( /\\s?<!-- wpnl -->\\s?/g, '\\n' );\n\t}\n\n\treturn text;\n}\n\n/**\n * Replaces `<p>` tags with two line breaks. \"Opposite\" of autop().\n *\n * Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.\n * Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.\n *\n * @param html The content from the editor.\n *\n * @example\n * ```js\n * import { removep } from '@wordpress/autop';\n * removep( '<p>my text</p>' ); // \"my text\"\n * ```\n *\n * @return The content with stripped paragraph tags.\n */\nexport function removep( html: string ): string {\n\tconst blocklist =\n\t\t'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';\n\tconst blocklist1 = blocklist + '|div|p';\n\tconst blocklist2 = blocklist + '|pre';\n\tconst preserve: string[] = [];\n\tlet preserveLinebreaks = false;\n\tlet preserveBr = false;\n\n\tif ( ! html ) {\n\t\treturn '';\n\t}\n\n\t// Protect script and style tags.\n\tif ( html.indexOf( '<script' ) !== -1 || html.indexOf( '<style' ) !== -1 ) {\n\t\thtml = html.replace(\n\t\t\t/<(script|style)[^>]*>[\\s\\S]*?<\\/\\1>/g,\n\t\t\t( match ) => {\n\t\t\t\tpreserve.push( match );\n\t\t\t\treturn '<wp-preserve>';\n\t\t\t}\n\t\t);\n\t}\n\n\t// Protect pre tags.\n\tif ( html.indexOf( '<pre' ) !== -1 ) {\n\t\tpreserveLinebreaks = true;\n\t\thtml = html.replace( /<pre[^>]*>[\\s\\S]+?<\\/pre>/g, ( a ) => {\n\t\t\ta = a.replace( /<br ?\\/?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\ta = a.replace( /<\\/?p( [^>]*)?>(\\r\\n|\\n)?/g, '<wp-line-break>' );\n\t\t\treturn a.replace( /\\r?\\n/g, '<wp-line-break>' );\n\t\t} );\n\t}\n\n\t// Remove line breaks but keep <br> tags inside image captions.\n\tif ( html.indexOf( '[caption' ) !== -1 ) {\n\t\tpreserveBr = true;\n\t\thtml = html.replace( /\\[caption[\\s\\S]+?\\[\\/caption\\]/g, ( a ) => {\n\t\t\treturn a\n\t\t\t\t.replace( /<br([^>]*)>/g, '<wp-temp-br$1>' )\n\t\t\t\t.replace( /[\\r\\n\\t]+/, '' );\n\t\t} );\n\t}\n\n\t// Normalize white space characters before and after block tags.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist1 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist1 + ')(?: [^>]*)?)>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\n\t// Mark </p> if it has any attributes.\n\thtml = html.replace( /(<p [^>]+>[\\s\\S]*?)<\\/p>/g, '$1</p#>' );\n\n\t// Preserve the first <p> inside a <div>.\n\thtml = html.replace( /<div( [^>]*)?>\\s*<p>/gi, '<div$1>\\n\\n' );\n\n\t// Remove paragraph tags.\n\thtml = html.replace( /\\s*<p>/gi, '' );\n\thtml = html.replace( /\\s*<\\/p>\\s*/gi, '\\n\\n' );\n\n\t// Normalize white space chars and remove multiple line breaks.\n\thtml = html.replace( /\\n[\\s\\u00a0]+\\n/g, '\\n\\n' );\n\n\t// Replace <br> tags with line breaks.\n\thtml = html.replace( /(\\s*)<br ?\\/?>\\s*/gi, ( _, space ) => {\n\t\tif ( space && space.indexOf( '\\n' ) !== -1 ) {\n\t\t\treturn '\\n\\n';\n\t\t}\n\n\t\treturn '\\n';\n\t} );\n\n\t// Fix line breaks around <div>.\n\thtml = html.replace( /\\s*<div/g, '\\n<div' );\n\thtml = html.replace( /<\\/div>\\s*/g, '</div>\\n' );\n\n\t// Fix line breaks around caption shortcodes.\n\thtml = html.replace(\n\t\t/\\s*\\[caption([^\\[]+)\\[\\/caption\\]\\s*/gi,\n\t\t'\\n\\n[caption$1[/caption]\\n\\n'\n\t);\n\thtml = html.replace( /caption\\]\\n\\n+\\[caption/g, 'caption]\\n\\n[caption' );\n\n\t// Pad block elements tags with a line break.\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*<((?:' + blocklist2 + ')(?: [^>]*)?)\\\\s*>', 'g' ),\n\t\t'\\n<$1>'\n\t);\n\thtml = html.replace(\n\t\tnew RegExp( '\\\\s*</(' + blocklist2 + ')>\\\\s*', 'g' ),\n\t\t'</$1>\\n'\n\t);\n\n\t// Indent <li>, <dt> and <dd> tags.\n\thtml = html.replace( /<((li|dt|dd)[^>]*)>/g, ' \\t<$1>' );\n\n\t// Fix line breaks around <select> and <option>.\n\tif ( html.indexOf( '<option' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<option/g, '\\n<option' );\n\t\thtml = html.replace( /\\s*<\\/select>/g, '\\n</select>' );\n\t}\n\n\t// Pad <hr> with two line breaks.\n\tif ( html.indexOf( '<hr' ) !== -1 ) {\n\t\thtml = html.replace( /\\s*<hr( [^>]*)?>\\s*/g, '\\n\\n<hr$1>\\n\\n' );\n\t}\n\n\t// Remove line breaks in <object> tags.\n\tif ( html.indexOf( '<object' ) !== -1 ) {\n\t\thtml = html.replace( /<object[\\s\\S]+?<\\/object>/g, ( a ) => {\n\t\t\treturn a.replace( /[\\r\\n]+/g, '' );\n\t\t} );\n\t}\n\n\t// Unmark special paragraph closing tags.\n\thtml = html.replace( /<\\/p#>/g, '</p>\\n' );\n\n\t// Pad remaining <p> tags whit a line break.\n\thtml = html.replace( /\\s*(<p [^>]+>[\\s\\S]*?<\\/p>)/g, '\\n$1' );\n\n\t// Trim.\n\thtml = html.replace( /^\\s+/, '' );\n\thtml = html.replace( /[\\s\\u00a0]+$/, '' );\n\n\tif ( preserveLinebreaks ) {\n\t\thtml = html.replace( /<wp-line-break>/g, '\\n' );\n\t}\n\n\tif ( preserveBr ) {\n\t\thtml = html.replace( /<wp-temp-br([^>]*)>/g, '<br$1>' );\n\t}\n\n\t// Restore preserved tags.\n\tif ( preserve.length ) {\n\t\thtml = html.replace( /<wp-preserve>/g, () => {\n\t\t\treturn preserve.shift() as string;\n\t\t} );\n\t}\n\n\treturn html;\n}\n"],"mappings":"AAAA;AACA;AACA;AACA,MAAMA,cAAsB,GAAG,CAAE,MAAM;EACtC;EACA,MAAMC,QAAQ,GACb,GAAG;EAAG;EACN,KAAK;EAAG;EACR,SAAS;EAAG;EACZ,SAAS;EAAG;EACZ,IAAI;EAAG;EACP,UAAU,CAAC,CAAC;;EAEb,MAAMC,KAAK,GACV,cAAc;EAAG;EACjB,SAAS;EAAG;EACZ,KAAK;EAAG;EACR,SAAS;EAAG;EACZ,SAAS;EAAG;EACZ,KAAK;EAAG;EACR,UAAU,CAAC,CAAC;;EAEb,MAAMC,OAAO,GACZ,KAAK;EAAG;EACR,KAAK,GACL,GAAG,GACH,cAAc,GACd,GAAG,GACH,SAAS;EAAG;EACZF,QAAQ,GACR,GAAG,GACHC,KAAK,GACL,GAAG;EAEJ,MAAME,KAAK,GACV,GAAG;EAAG;EACN,GAAG;EAAG;EACN,GAAG;EAAG;EACND,OAAO;EAAG;EACV,GAAG;EAAG;EACN,SAAS;EAAG;EACZ,GAAG,GACH,GAAG;EAEJ,O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C1B,OAAO,CAAE,sBAAsB,EAAE,QAAS,CAAC;EACxD;;EAEA;EACA,IAAK8B,QAAQ,CAAC3C,MAAM,EAAG;IACtBuC,IAAI,GAAGA,IAAI,CAAC1B,OAAO,CAAE,gBAAgB,EAAE,MAAM;MAC5C,OAAO8B,QAAQ,CAACK,KAAK,CAAC,CAAC;IACxB,CAAE,CAAC;EACJ;EAEA,OAAOT,IAAI;AACZ","ignoreList":[]}
|
package/build-types/index.d.ts
CHANGED
|
@@ -5,9 +5,9 @@
|
|
|
5
5
|
* replace double line-breaks with HTML paragraph tags. The remaining line-
|
|
6
6
|
* breaks after conversion become `<br />` tags, unless br is set to 'false'.
|
|
7
7
|
*
|
|
8
|
-
* @param
|
|
9
|
-
* @param
|
|
10
|
-
*
|
|
8
|
+
* @param text The text which has to be formatted.
|
|
9
|
+
* @param br Optional. If set, will convert all remaining line-
|
|
10
|
+
* breaks after paragraphing. Default true.
|
|
11
11
|
*
|
|
12
12
|
* @example
|
|
13
13
|
*```js
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
* autop( 'my text' ); // "<p>my text</p>"
|
|
16
16
|
* ```
|
|
17
17
|
*
|
|
18
|
-
* @return
|
|
18
|
+
* @return Text which has been converted into paragraph tags.
|
|
19
19
|
*/
|
|
20
|
-
export function autop(text: string, br?: boolean): string;
|
|
20
|
+
export declare function autop(text: string, br?: boolean): string;
|
|
21
21
|
/**
|
|
22
22
|
* Replaces `<p>` tags with two line breaks. "Opposite" of autop().
|
|
23
23
|
*
|
|
24
24
|
* Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.
|
|
25
25
|
* Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.
|
|
26
26
|
*
|
|
27
|
-
* @param
|
|
27
|
+
* @param html The content from the editor.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```js
|
|
@@ -32,7 +32,7 @@ export function autop(text: string, br?: boolean): string;
|
|
|
32
32
|
* removep( '<p>my text</p>' ); // "my text"
|
|
33
33
|
* ```
|
|
34
34
|
*
|
|
35
|
-
* @return
|
|
35
|
+
* @return The content with stripped paragraph tags.
|
|
36
36
|
*/
|
|
37
|
-
export function removep(html: string): string;
|
|
37
|
+
export declare function removep(html: string): string;
|
|
38
38
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAyHA;;;;;;;;;;;;;;;;;;GAkBG;AACH,wBAAgB,KAAK,CAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAE,OAAc,GAAI,MAAM,CAyLhE;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,OAAO,CAAE,IAAI,EAAE,MAAM,GAAI,MAAM,CAgJ9C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/autop",
|
|
3
|
-
"version": "4.0
|
|
3
|
+
"version": "4.2.0",
|
|
4
4
|
"description": "WordPress's automatic paragraph functions `autop` and `removep`.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -33,5 +33,5 @@
|
|
|
33
33
|
"publishConfig": {
|
|
34
34
|
"access": "public"
|
|
35
35
|
},
|
|
36
|
-
"gitHead": "
|
|
36
|
+
"gitHead": "aa5b14bb5bdbb8d8a02914e154c3bc1c2f18ace6"
|
|
37
37
|
}
|
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The regular expression for an HTML element.
|
|
3
|
-
*
|
|
4
|
-
* @type {RegExp}
|
|
5
3
|
*/
|
|
6
|
-
const htmlSplitRegex = ( () => {
|
|
4
|
+
const htmlSplitRegex: RegExp = ( () => {
|
|
7
5
|
/* eslint-disable no-multi-spaces */
|
|
8
6
|
const comments =
|
|
9
7
|
'!' + // Start of comment, after the <.
|
|
@@ -51,11 +49,11 @@ const htmlSplitRegex = ( () => {
|
|
|
51
49
|
/**
|
|
52
50
|
* Separate HTML elements and comments from the text.
|
|
53
51
|
*
|
|
54
|
-
* @param
|
|
52
|
+
* @param input The text which has to be formatted.
|
|
55
53
|
*
|
|
56
|
-
* @return
|
|
54
|
+
* @return The formatted text.
|
|
57
55
|
*/
|
|
58
|
-
function htmlSplit( input ) {
|
|
56
|
+
function htmlSplit( input: string ): string[] {
|
|
59
57
|
const parts = [];
|
|
60
58
|
let workingInput = input;
|
|
61
59
|
|
|
@@ -65,7 +63,7 @@ function htmlSplit( input ) {
|
|
|
65
63
|
// If the `g` flag is omitted, `index` is included.
|
|
66
64
|
// `htmlSplitRegex` does not have the `g` flag so we can assert it will have an index number.
|
|
67
65
|
// Assert `match.index` is a number.
|
|
68
|
-
const index =
|
|
66
|
+
const index = match.index as number;
|
|
69
67
|
|
|
70
68
|
parts.push( workingInput.slice( 0, index ) );
|
|
71
69
|
parts.push( match[ 0 ] );
|
|
@@ -82,12 +80,15 @@ function htmlSplit( input ) {
|
|
|
82
80
|
/**
|
|
83
81
|
* Replace characters or phrases within HTML elements only.
|
|
84
82
|
*
|
|
85
|
-
* @param
|
|
86
|
-
* @param
|
|
83
|
+
* @param haystack The text which has to be formatted.
|
|
84
|
+
* @param replacePairs In the form {from: 'to', …}.
|
|
87
85
|
*
|
|
88
|
-
* @return
|
|
86
|
+
* @return The formatted text.
|
|
89
87
|
*/
|
|
90
|
-
function replaceInHtmlTags(
|
|
88
|
+
function replaceInHtmlTags(
|
|
89
|
+
haystack: string,
|
|
90
|
+
replacePairs: Record< string, string >
|
|
91
|
+
): string {
|
|
91
92
|
// Find all elements.
|
|
92
93
|
const textArr = htmlSplit( haystack );
|
|
93
94
|
let changed = false;
|
|
@@ -125,9 +126,9 @@ function replaceInHtmlTags( haystack, replacePairs ) {
|
|
|
125
126
|
* replace double line-breaks with HTML paragraph tags. The remaining line-
|
|
126
127
|
* breaks after conversion become `<br />` tags, unless br is set to 'false'.
|
|
127
128
|
*
|
|
128
|
-
* @param
|
|
129
|
-
* @param
|
|
130
|
-
*
|
|
129
|
+
* @param text The text which has to be formatted.
|
|
130
|
+
* @param br Optional. If set, will convert all remaining line-
|
|
131
|
+
* breaks after paragraphing. Default true.
|
|
131
132
|
*
|
|
132
133
|
* @example
|
|
133
134
|
*```js
|
|
@@ -135,10 +136,10 @@ function replaceInHtmlTags( haystack, replacePairs ) {
|
|
|
135
136
|
* autop( 'my text' ); // "<p>my text</p>"
|
|
136
137
|
* ```
|
|
137
138
|
*
|
|
138
|
-
* @return
|
|
139
|
+
* @return Text which has been converted into paragraph tags.
|
|
139
140
|
*/
|
|
140
|
-
export function autop( text, br = true ) {
|
|
141
|
-
const preTags = [];
|
|
141
|
+
export function autop( text: string, br: boolean = true ): string {
|
|
142
|
+
const preTags: Array< [ string, string ] > = [];
|
|
142
143
|
|
|
143
144
|
if ( text.trim() === '' ) {
|
|
144
145
|
return '';
|
|
@@ -330,7 +331,7 @@ export function autop( text, br = true ) {
|
|
|
330
331
|
* Replaces `<p>` tags with two line breaks except where the `<p>` has attributes.
|
|
331
332
|
* Unifies whitespace. Indents `<li>`, `<dt>` and `<dd>` for better readability.
|
|
332
333
|
*
|
|
333
|
-
* @param
|
|
334
|
+
* @param html The content from the editor.
|
|
334
335
|
*
|
|
335
336
|
* @example
|
|
336
337
|
* ```js
|
|
@@ -338,15 +339,14 @@ export function autop( text, br = true ) {
|
|
|
338
339
|
* removep( '<p>my text</p>' ); // "my text"
|
|
339
340
|
* ```
|
|
340
341
|
*
|
|
341
|
-
* @return
|
|
342
|
+
* @return The content with stripped paragraph tags.
|
|
342
343
|
*/
|
|
343
|
-
export function removep( html ) {
|
|
344
|
+
export function removep( html: string ): string {
|
|
344
345
|
const blocklist =
|
|
345
346
|
'blockquote|ul|ol|li|dl|dt|dd|table|thead|tbody|tfoot|tr|th|td|h[1-6]|fieldset|figure';
|
|
346
347
|
const blocklist1 = blocklist + '|div|p';
|
|
347
348
|
const blocklist2 = blocklist + '|pre';
|
|
348
|
-
|
|
349
|
-
const preserve = [];
|
|
349
|
+
const preserve: string[] = [];
|
|
350
350
|
let preserveLinebreaks = false;
|
|
351
351
|
let preserveBr = false;
|
|
352
352
|
|
|
@@ -480,7 +480,7 @@ export function removep( html ) {
|
|
|
480
480
|
// Restore preserved tags.
|
|
481
481
|
if ( preserve.length ) {
|
|
482
482
|
html = html.replace( /<wp-preserve>/g, () => {
|
|
483
|
-
return
|
|
483
|
+
return preserve.shift() as string;
|
|
484
484
|
} );
|
|
485
485
|
}
|
|
486
486
|
|
|
@@ -311,7 +311,7 @@ test( 'that_autop_treats_block_level_elements_as_blocks', () => {
|
|
|
311
311
|
];
|
|
312
312
|
|
|
313
313
|
// Check whitespace normalization.
|
|
314
|
-
let content = [];
|
|
314
|
+
let content: string[] = [];
|
|
315
315
|
|
|
316
316
|
blocks.forEach( ( block ) => {
|
|
317
317
|
content.push( `<${ block }>foo</${ block }>` );
|
|
@@ -388,18 +388,18 @@ test( 'that autop treats inline elements as inline', () => {
|
|
|
388
388
|
'select',
|
|
389
389
|
];
|
|
390
390
|
|
|
391
|
-
|
|
392
|
-
|
|
391
|
+
const content: string[] = [];
|
|
392
|
+
const expected: string[] = [];
|
|
393
393
|
|
|
394
394
|
inlines.forEach( ( inline ) => {
|
|
395
395
|
content.push( `<${ inline }>foo</${ inline }>` );
|
|
396
396
|
expected.push( `<p><${ inline }>foo</${ inline }></p>` );
|
|
397
397
|
} );
|
|
398
398
|
|
|
399
|
-
|
|
400
|
-
|
|
399
|
+
const contentString = content.join( '\n\n' );
|
|
400
|
+
const expectedString = expected.join( '\n' );
|
|
401
401
|
|
|
402
|
-
expect( autop(
|
|
402
|
+
expect( autop( contentString ).trim() ).toBe( expectedString );
|
|
403
403
|
} );
|
|
404
404
|
|
|
405
405
|
test( 'element sanity', () => {
|
package/tsconfig.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/index.js"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","886e50ef125efb7878f744e86908884c0133e7a6d9d80013f421b0cd8fb2af94",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"462499596152f3060a799ee2a0434ae2708a1e17122b5422b6b34b9274ee7ca6","signature":"3943af34f810f4550194328b66114ddf0030ac5fe415fb42129fb7d99ab53cd3"}],"root":[70],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[68,69,12,13,15,14,2,16,17,18,19,20,21,22,23,3,24,4,25,29,26,27,28,30,31,32,5,33,34,35,36,6,40,37,38,39,41,7,42,47,48,43,44,45,46,8,52,49,50,51,53,9,54,55,56,59,57,58,60,61,10,1,62,11,66,64,63,67,65,70],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.4.5"}
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.promise.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.object.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","./src/index.ts"],"fileInfos":[{"version":"824cb491a40f7e8fdeb56f1df5edf91b23f3e3ee6b4cde84d4a99be32338faee","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","3facaf05f0c5fc569c5649dd359892c98a85557e3e0c847964caeb67076f4d75","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","886e50ef125efb7878f744e86908884c0133e7a6d9d80013f421b0cd8fb2af94",{"version":"87d693a4920d794a73384b3c779cadcb8548ac6945aa7a925832fe2418c9527a","affectsGlobalScope":true},{"version":"76f838d5d49b65de83bc345c04aa54c62a3cfdb72a477dc0c0fce89a30596c30","affectsGlobalScope":true},{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"ea011c76963fb15ef1cdd7ce6a6808b46322c527de2077b6cfdf23ae6f5f9ec7","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"b20fe0eca9a4e405f1a5ae24a2b3290b37cf7f21eba6cbe4fc3fab979237d4f3","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"5e07ed3809d48205d5b985642a59f2eba47c402374a7cf8006b686f79efadcbd","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"8073890e29d2f46fdbc19b8d6d2eb9ea58db9a2052f8640af20baff9afbc8640","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"956d27abdea9652e8368ce029bb1e0b9174e9678a273529f426df4b3d90abd60","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"d8670852241d4c6e03f2b89d67497a4bbefe29ecaa5a444e2c11a9b05e6fccc6","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"b1cb28af0c891c8c96b2d6b7be76bd394fddcfdb4709a20ba05a7c1605eea0f9","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"15b98a533864d324e5f57cd3cfc0579b231df58c1c0f6063ea0fcb13c3c74ff9","affectsGlobalScope":true},{"version":"ac77cb3e8c6d3565793eb90a8373ee8033146315a3dbead3bde8db5eaf5e5ec6","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"2fef54945a13095fdb9b84f705f2b5994597640c46afeb2ce78352fab4cb3279","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"462325eddb13c45fdbc8db319ed1a4b914226572aee688d963528eebf12e652d","signature":"89e3edb07b0dfc586026d07e433f2238ace738301592020c17d7f1ae503e92b5"}],"root":[70],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"checkJs":true,"composite":true,"declaration":true,"declarationDir":"./build-types","declarationMap":true,"emitDeclarationOnly":true,"esModuleInterop":false,"jsx":1,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"rootDir":"./src","strict":true,"target":99},"referencedMap":[],"exportedModulesMap":[],"semanticDiagnosticsPerFile":[68,69,12,13,15,14,2,16,17,18,19,20,21,22,23,3,24,4,25,29,26,27,28,30,31,32,5,33,34,35,36,6,40,37,38,39,41,7,42,47,48,43,44,45,46,8,52,49,50,51,53,9,54,55,56,59,57,58,60,61,10,1,62,11,66,64,63,67,65,70],"latestChangedDtsFile":"./build-types/index.d.ts"},"version":"5.4.5"}
|