is-html-tag-opening 4.1.3 → 4.2.1
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 -2
- package/LICENSE +1 -1
- package/README.md +6 -12
- package/dist/is-html-tag-opening.esm.js +4 -4
- package/dist/is-html-tag-opening.umd.js +18 -18
- package/package.json +24 -24
package/CHANGELOG.md
CHANGED
|
@@ -3,11 +3,23 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
-
## 4.
|
|
6
|
+
## 4.2.0 (2026-08-19)
|
|
7
|
+
|
|
8
|
+
### Bug Fixes
|
|
9
|
+
|
|
10
|
+
- make validation diagnostics safe ([7b01074](https://github.com/codsen/codsen/commit/7b0107476f12734aeb8e82852ba980b187280110))
|
|
11
|
+
- resolve review findings REV-004 through REV-007 ([b60e9ee](https://github.com/codsen/codsen/commit/b60e9eeb499af94685cfb87b4970fe025be1fc10))
|
|
12
|
+
- retire direct publish aliases ([f98e31e](https://github.com/codsen/codsen/commit/f98e31eb89bc185471225664e610b55f34fbf648))
|
|
7
13
|
|
|
8
14
|
### Features
|
|
9
15
|
|
|
10
|
-
-
|
|
16
|
+
- add codsen-glob and migrate glob consumers ([5595a2b](https://github.com/codsen/codsen/commit/5595a2b267eaa6cb60072d037aef00b7a28edd42))
|
|
17
|
+
- refresh the tooling and generate with the latest dependencies ([781f802](https://github.com/codsen/codsen/commit/781f802911066a82a4533b0e5a3fcbd742d0dd83))
|
|
18
|
+
|
|
19
|
+
### Reverts
|
|
20
|
+
|
|
21
|
+
- Revert "Merge pull request #128 from codsen/release/npm-32198404552-1" ([5baeeaa](https://github.com/codsen/codsen/commit/5baeeaaa677b86f1eaa6396cadf3aea32b06416e)), closes [#128](https://github.com/codsen/codsen/issues/128)
|
|
22
|
+
- Revert "Merge pull request #127 from codsen/release/npm-32194020886-1" ([5f1e94d](https://github.com/codsen/codsen/commit/5f1e94deef910ce735266b16aeee08a76de7a862)), closes [#127](https://github.com/codsen/codsen/issues/127)
|
|
11
23
|
|
|
12
24
|
## 4.0.0 (2022-12-01)
|
|
13
25
|
|
package/LICENSE
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
MIT License
|
|
2
2
|
|
|
3
|
-
Copyright © 2010-
|
|
3
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
4
4
|
|
|
5
5
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
6
6
|
a copy of this software and associated documentation files (the
|
package/README.md
CHANGED
|
@@ -32,25 +32,19 @@ npm i is-html-tag-opening
|
|
|
32
32
|
## Quick Take
|
|
33
33
|
|
|
34
34
|
```js
|
|
35
|
-
import { strict as assert } from "assert";
|
|
35
|
+
import { strict as assert } from "node:assert";
|
|
36
36
|
|
|
37
37
|
import { isOpening } from "is-html-tag-opening";
|
|
38
38
|
|
|
39
|
-
const
|
|
39
|
+
const html = "<span>Text</span>";
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
assert.equal(isOpening(text, 0), true);
|
|
43
|
-
|
|
44
|
-
// unencoded bracket between a and b
|
|
45
|
-
assert.equal(isOpening(text, 8), false);
|
|
46
|
-
|
|
47
|
-
// closing span tag's opening
|
|
48
|
-
assert.equal(isOpening(text, 11), true);
|
|
41
|
+
assert.equal(isOpening(html, 0), true);
|
|
49
42
|
```
|
|
50
43
|
|
|
44
|
+
|
|
51
45
|
## Documentation
|
|
52
46
|
|
|
53
|
-
Please [visit codsen.com](https://codsen.com/os/is-html-tag-opening/) for a full description of the API.
|
|
47
|
+
Please [visit codsen.com](https://codsen.com/os/is-html-tag-opening/) for a full description of the API. If you’re looking for the **Changelog**, it’s [here](https://github.com/codsen/codsen/blob/main/packages/is-html-tag-opening/CHANGELOG.md).
|
|
54
48
|
|
|
55
49
|
## Contributing
|
|
56
50
|
|
|
@@ -60,6 +54,6 @@ To report bugs or request features or assistance, [raise an issue](https://githu
|
|
|
60
54
|
|
|
61
55
|
MIT License
|
|
62
56
|
|
|
63
|
-
Copyright © 2010-
|
|
57
|
+
Copyright © 2010-2026 Roy Revelt and other contributors
|
|
64
58
|
|
|
65
59
|
<p align="center"><img src="https://codsen.com/images/png-codsen-ok.png" width="98" alt="ok" align="center"> <img src="https://codsen.com/images/png-codsen-1.png" width="148" alt="codsen" align="center"> <img src="https://codsen.com/images/png-codsen-star-small.png" width="32" alt="star" align="center"></p>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name is-html-tag-opening
|
|
3
3
|
* @fileoverview Does an HTML tag start at given position?
|
|
4
|
-
* @version 4.1
|
|
4
|
+
* @version 4.2.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/is-html-tag-opening/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import{matchRight as
|
|
11
|
-
`,"\r"]};return n.allowCustomTagNames?((n.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[c(e,a)]==="<")||s[0]==="<"&&s[1]?.trim())&&($.test(s)||/^<\w+$/.test(s))||
|
|
12
|
-
`,"\r"]})&&(o=!0)),!o&&e[t]==="<"&&e[t+1]?.trim()&&
|
|
10
|
+
import{formatDiagnosticValue as h}from"codsen-utils";import{left as c}from"string-left-right";import{matchRight as q,matchRightIncl as F}from"string-match-left-right";var d="4.2.1";import{left as j}from"string-left-right";function p(e,t){return e[t]==="<"||e[j(e,t)]==="<"}function b(e){return e===void 0||e.toUpperCase()===e.toLowerCase()&&!/\d/.test(e)&&e!=="="}var f={allowCustomTagNames:!1,skipOpeningBracket:!1},m="\\",g=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];var W=d;function P(e,t=0,k){if(typeof e!="string")throw new Error(`is-html-tag-opening/isOpening(): [THROW_ID_01] the first input argument should have been a string but it was given as "${typeof e}", value being ${h(e,4)}`);if(!Number.isInteger(t)||t<0)throw new Error(`is-html-tag-opening/isOpening(): [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "${typeof t}", value being ${h(t,4)}`);let n={...f,...k},i="[\\\\ \\t\\r\\n/]*",r="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",w=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}\\w+${i}\\/?${i}>`,"g"),E=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}[${r}]+[-${r}]*${i}>`,"g"),y=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['"\\w]`,"g"),D=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\w+\\s+[${r}]+[-${r}]*(?:-\\w+)?\\s*=\\s*['"\\w]`),O=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\/?\\s*\\w+\\s*\\/?\\s*>`,"g"),v=new RegExp(`^<${n.skipOpeningBracket?"?":""}\\s*\\/?\\s*[${r}]+[-${r}]*\\s*\\/?\\s*>`,"g"),R=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}\\w+(?:\\s*\\w+)?\\s*\\w+=['"]`,"g"),V=new RegExp(`^<${n.skipOpeningBracket?"?":""}${i}[${r}]+[-${r}]*\\s+(?:\\s*\\w+)?\\s*\\w+=['"]`,"g"),$=new RegExp(`^<${n.skipOpeningBracket?"?\\/?":""}(${i}[${r}]+)+${i}[\\\\/=>]`,""),B=/^\/\s*\w+s*>/,s=t?e.slice(t):e,a=c(e,t),l=!1,o=!1,C={cb:b,i:!0,trimCharsBeforeMatching:["/",m,"!"," "," ",`
|
|
11
|
+
`,"\r"]};return n.allowCustomTagNames?((n.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[c(e,a)]==="<")||s[0]==="<"&&s[1]?.trim())&&($.test(s)||/^<\w+$/.test(s))||E.test(s)&&p(e,t)||D.test(s)||v.test(s)&&p(e,t)||V.test(s)||e[t]==="/"&&e[a]!=="<"&&B.test(s))&&(o=!0):(((n.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[c(e,a)]==="<")||(s[0]==="<"||s[0]==="/"&&(!e[a]||e[a]!=="<"))&&s[1]?.trim())&&$.test(s)||w.test(s)&&p(e,t)||y.test(s)||O.test(s)&&p(e,t)||R.test(s))&&(l=!0),l&&F(e,t,g,{cb:u=>u===void 0?((e[t]==="<"&&e[t+1]?.trim()||e[t-1]==="<")&&(o=!0),!0):u.toUpperCase()===u.toLowerCase()&&!/\d/.test(u)&&u!=="=",i:!0,trimCharsBeforeMatching:["<","/",m,"!"," "," ",`
|
|
12
|
+
`,"\r"]})&&(o=!0)),!o&&e[t]==="<"&&e[t+1]?.trim()&&q(e,t,g,C)&&(o=!0),typeof e=="string"&&t<e.length&&o}export{f as defaults,P as isOpening,W as version};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @name is-html-tag-opening
|
|
3
3
|
* @fileoverview Does an HTML tag start at given position?
|
|
4
|
-
* @version 4.1
|
|
4
|
+
* @version 4.2.1
|
|
5
5
|
* @author Roy Revelt
|
|
6
6
|
* @license MIT
|
|
7
7
|
* {@link https://codsen.com/os/is-html-tag-opening/}
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
"use strict";var isHtmlTagOpening=(()=>{var te=Object.create;var D=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames,H=Object.getOwnPropertySymbols,ie=Object.getPrototypeOf,_=Object.prototype.hasOwnProperty,se=Object.prototype.propertyIsEnumerable;var F=(e,t,n)=>t in e?D(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n,O=(e,t)=>{for(var n in t||(t={}))_.call(t,n)&&F(e,n,t[n]);if(H)for(var n of H(t))se.call(t,n)&&F(e,n,t[n]);return e};var oe=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),ue=(e,t)=>{for(var n in t)D(e,n,{get:t[n],enumerable:!0})},q=(e,t,n,l)=>{if(t&&typeof t=="object"||typeof t=="function")for(let u of ne(t))!_.call(e,u)&&u!==n&&D(e,u,{get:()=>t[u],enumerable:!(l=re(t,u))||l.enumerable});return e};var W=(e,t,n)=>(n=e!=null?te(ie(e)):{},q(t||!e||!e.__esModule?D(n,"default",{value:e,enumerable:!0}):n,e)),ae=e=>q(D({},"__esModule",{value:!0}),e);var S=oe(($e,J)=>{"use strict";J.exports=le;function B(e){return e instanceof Buffer?Buffer.from(e):new e.constructor(e.buffer.slice(),e.byteOffset,e.length)}function le(e){if(e=e||{},e.circles)return ce(e);let t=new Map;if(t.set(Date,i=>new Date(i)),t.set(Map,(i,s)=>new Map(l(Array.from(i),s))),t.set(Set,(i,s)=>new Set(l(Array.from(i),s))),e.constructorHandlers)for(let i of e.constructorHandlers)t.set(i[0],i[1]);let n=null;return e.proto?c:u;function l(i,s){let r=Object.keys(i),o=new Array(r.length);for(let g=0;g<r.length;g++){let f=r[g],p=i[f];typeof p!="object"||p===null?o[f]=p:p.constructor!==Object&&(n=t.get(p.constructor))?o[f]=n(p,s):ArrayBuffer.isView(p)?o[f]=B(p):o[f]=s(p)}return o}function u(i){if(typeof i!="object"||i===null)return i;if(Array.isArray(i))return l(i,u);if(i.constructor!==Object&&(n=t.get(i.constructor)))return n(i,u);let s={};for(let r in i){if(Object.hasOwnProperty.call(i,r)===!1)continue;let o=i[r];typeof o!="object"||o===null?s[r]=o:o.constructor!==Object&&(n=t.get(o.constructor))?s[r]=n(o,u):ArrayBuffer.isView(o)?s[r]=B(o):s[r]=u(o)}return s}function c(i){if(typeof i!="object"||i===null)return i;if(Array.isArray(i))return l(i,c);if(i.constructor!==Object&&(n=t.get(i.constructor)))return n(i,c);let s={};for(let r in i){let o=i[r];typeof o!="object"||o===null?s[r]=o:o.constructor!==Object&&(n=t.get(o.constructor))?s[r]=n(o,c):ArrayBuffer.isView(o)?s[r]=B(o):s[r]=c(o)}return s}}function ce(e){let t=[],n=[],l=new Map;if(l.set(Date,r=>new Date(r)),l.set(Map,(r,o)=>new Map(c(Array.from(r),o))),l.set(Set,(r,o)=>new Set(c(Array.from(r),o))),e.constructorHandlers)for(let r of e.constructorHandlers)l.set(r[0],r[1]);let u=null;return e.proto?s:i;function c(r,o){let g=Object.keys(r),f=new Array(g.length);for(let p=0;p<g.length;p++){let m=g[p],a=r[m];if(typeof a!="object"||a===null)f[m]=a;else if(a.constructor!==Object&&(u=l.get(a.constructor)))f[m]=u(a,o);else if(ArrayBuffer.isView(a))f[m]=B(a);else{let b=t.indexOf(a);b!==-1?f[m]=n[b]:f[m]=o(a)}}return f}function i(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return c(r,i);if(r.constructor!==Object&&(u=l.get(r.constructor)))return u(r,i);let o={};t.push(r),n.push(o);for(let g in r){if(Object.hasOwnProperty.call(r,g)===!1)continue;let f=r[g];if(typeof f!="object"||f===null)o[g]=f;else if(f.constructor!==Object&&(u=l.get(f.constructor)))o[g]=u(f,i);else if(ArrayBuffer.isView(f))o[g]=B(f);else{let p=t.indexOf(f);p!==-1?o[g]=n[p]:o[g]=i(f)}}return t.pop(),n.pop(),o}function s(r){if(typeof r!="object"||r===null)return r;if(Array.isArray(r))return c(r,s);if(r.constructor!==Object&&(u=l.get(r.constructor)))return u(r,s);let o={};t.push(r),n.push(o);for(let g in r){let f=r[g];if(typeof f!="object"||f===null)o[g]=f;else if(f.constructor!==Object&&(u=l.get(f.constructor)))o[g]=u(f,s);else if(ArrayBuffer.isView(f))o[g]=B(f);else{let p=t.indexOf(f);p!==-1?o[g]=n[p]:o[g]=s(f)}}return t.pop(),n.pop(),o}}});var be={};ue(be,{defaults:()=>j,isOpening:()=>de,version:()=>he});function P(e){return typeof e!="string"?e:e.length?[e]:[]}var U=W(S(),1);var Ae=(0,U.default)();function L(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function C(e){return typeof e=="string"}function Q(e,t){return L(e)&&C(t)&&t in e}var K={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},fe=e=>e+1;function ge(e,t,n,l,u=!1,c=fe){var h;let i=typeof n=="function"?n():n;if(+t<0&&u&&i==="EOL")return i;let s=O(O({},K),l);if(t>=e.length&&!u)return!1;let r=u?1:n.length,o=0,g=!1,f=!1,p=!1,m=s.maxMismatches,a=t,b=!1,d=!1,w=!1;function $(){return o===1&&m<s.maxMismatches-1}for(;e[a];){let y=c(a);if(s.trimBeforeMatching&&e[a].trim()===""){if(!e[y]&&u&&n==="EOL")return!0;a=c(a);continue}if(s&&!s.i&&((h=s==null?void 0:s.trimCharsBeforeMatching)!=null&&h.includes(e[a]))||s!=null&&s.i&&s.trimCharsBeforeMatching&&s.trimCharsBeforeMatching.map(v=>v.toLowerCase()).includes(e[a].toLowerCase())){if(u&&n==="EOL"&&!e[y])return!0;a=c(a);continue}let k=y>a?n[n.length-r]:n[r-1];if(!s.i&&e[a]===k||s.i&&e[a].toLowerCase()===k.toLowerCase()){if(b||(b=!0),p||(p=!0),r===n.length){if(d=!0,m!==s.maxMismatches)return!1}else r===1&&(w=!0);if(r-=1,o++,$())return!1;if(!r)return o!==n.length||m===s.maxMismatches||!g?a:!1}else if(!g&&!o&&(g=!0),s.maxMismatches&&m&&a){m-=1;for(let v=0;v<=m;v++){let A=y>a?n[n.length-r+1+v]:n[r-2-v],E=e[c(a)];if(A&&(!s.i&&e[a]===A||s.i&&e[a].toLowerCase()===A.toLowerCase())&&(!s.firstMustMatch||r!==n.length)){if(o++,$())return!1;r-=2,b=!0;break}else if(E&&A&&(!s.i&&E===A||s.i&&E.toLowerCase()===A.toLowerCase())&&(!s.firstMustMatch||r!==n.length)){if(!o&&!s.hungry)return!1;r-=1,b=!0;break}else if(A===void 0&&m>=0&&b&&(!s.firstMustMatch||d)&&(!s.lastMustMatch||w))return a}b||(f=a)}else return a===0&&r===1&&!s.lastMustMatch&&p?0:!1;if(f!==!1&&f!==a&&(f=!1),r<1)return a;a=c(a)}if(r>0)return u&&i==="EOL"?!0:s&&s.maxMismatches>=r&&p?f||0:!1}function z(e,t,n,l,u){var g,f,p;if(L(u)&&Q(u,"trimBeforeMatching")&&u&&typeof u.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_09] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(u.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let c=O(O({},K),u);if(typeof c.trimCharsBeforeMatching=="string"&&(c.trimCharsBeforeMatching=P(c.trimCharsBeforeMatching)),c.trimCharsBeforeMatching=c.trimCharsBeforeMatching.map(m=>C(m)?m:String(m)),!C(t)||!t.length)return!1;if(!Number.isInteger(n)||n<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the second argument should be a natural number. Currently it's of a type: ").concat(typeof n,", equal to:\n").concat(JSON.stringify(n,null,4)));let i,s;if(C(l))i=[l];else if(Array.isArray(l))i=l;else if(!l)i=l;else if(typeof l=="function")i=[],i.push(l);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof l,", equal to:\n").concat(JSON.stringify(l,null,4)));if(u&&!L(u))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_06] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof u,'", and equal to:\n').concat(JSON.stringify(u,null,4)));let r=0,o="";if((g=c==null?void 0:c.trimCharsBeforeMatching)!=null&&g.some((m,a)=>m.length>1?(r=a,o=m,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_07] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(r," is longer than 1 character, ").concat(o.length," (equals to ").concat(o,"). Please split it into separate characters and put into array as separate elements."));if(!i||!Array.isArray(i)||Array.isArray(i)&&!i.length||Array.isArray(i)&&i.length===1&&C(i[0])&&!i[0].trim()){if(typeof c.cb=="function"){let a,b=n;if((e==="matchLeftIncl"||e==="matchRight")&&(b+=1),e[5]==="L")for(let h=b;h--;){let y=t[h];if((!c.trimBeforeMatching||c.trimBeforeMatching&&(y!=null&&y.trim()))&&(!((f=c.trimCharsBeforeMatching)!=null&&f.length)||y!==void 0&&!c.trimCharsBeforeMatching.includes(y))){a=h;break}}else if(e.startsWith("matchRight"))for(let h=b;h<t.length;h++){let y=t[h];if((!c.trimBeforeMatching||c.trimBeforeMatching&&y.trim())&&(!((p=c.trimCharsBeforeMatching)!=null&&p.length)||!c.trimCharsBeforeMatching.includes(y))){a=h;break}}if(a===void 0)return!1;let d=t[a],w=a+1,$="";return w&&w>0&&($=t.slice(0,w)),e[5]==="L"||a&&a>0&&($=t.slice(a)),c.cb(d,$,a)}let m="";throw u||(m=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_08] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(m))}for(let m=0,a=i.length;m<a;m++){s=typeof i[m]=="function";let b=i[m],d,w,$="",h=n;e==="matchRight"?h+=1:e==="matchLeft"&&(h-=1);let y=ge(t,h,b,c,s,k=>e[5]==="L"?k-1:k+1);if(y&&s&&typeof b=="function"&&b()==="EOL")return b()&&(!c.cb||c.cb(d,$,w))?b():!1;if(Number.isInteger(y)&&(w=e.startsWith("matchLeft")?y-1:y+1,e[5]==="L"?$=t.slice(0,y):$=t.slice(w)),w<0&&(w=void 0),t[w]&&(d=t[w]),Number.isInteger(y)&&(!c.cb||c.cb(d,$,w)))return b}return!1}function G(e,t,n,l){return z("matchRightIncl",e,t,n,l)}function Z(e,t,n,l){return z("matchRight",e,t,n,l)}var Y=W(S(),1);var Re=(0,Y.default)();var x="\xA0";function me({str:e,idx:t,stopAtNewlines:n,stopAtRawNbsp:l}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||n&&"\n\r".includes(e[~-t])||l&&e[~-t]===x))return~-t;if(e[t-2]&&(e[t-2].trim()||n&&"\n\r".includes(e[t-2])||l&&e[t-2]===x))return t-2;for(let u=t;u--;)if(e[u]&&(e[u].trim()||n&&"\n\r".includes(e[u])||l&&e[u]===x))return u;return null}function M(e,t=0){return me({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}var j={allowCustomTagNames:!1,skipOpeningBracket:!1},T="\\",I=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];function X(e){return e===void 0||e.toUpperCase()===e.toLowerCase()&&!/\d/.test(e)&&e!=="="}function N(e,t){return e[t]==="<"||e[M(e,t)]==="<"}var ee="4.1.3";var he=ee;function de(e,t=0,n){var v,A,E;if(typeof e!="string")throw new Error('is-html-tag-opening: [THROW_ID_01] the first input argument should have been a string but it was given as "'.concat(typeof e,'", value being ').concat(JSON.stringify(e,null,4)));if(!Number.isInteger(t)||t<0)throw new Error('is-html-tag-opening: [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "'.concat(typeof t,'", value being ').concat(JSON.stringify(t,null,4)));let l=O(O({},j),n),u="[\\\\ \\t\\r\\n/]*",c="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",i=new RegExp("^<".concat(l.skipOpeningBracket?"?":"").concat(u,"\\w+").concat(u,"\\/?").concat(u,">"),"g"),s=new RegExp("^<".concat(l.skipOpeningBracket?"?":"").concat(u,"[").concat(c,"]+[-").concat(c,"]*").concat(u,">"),"g"),r=new RegExp("^<".concat(l.skipOpeningBracket?"?":"","\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['\"\\w]"),"g"),o=new RegExp("^<".concat(l.skipOpeningBracket?"?":"","\\s*\\w+\\s+[").concat(c,"]+[-").concat(c,"]*(?:-\\w+)?\\s*=\\s*['\"\\w]")),g=new RegExp("^<".concat(l.skipOpeningBracket?"?":"","\\s*\\/?\\s*\\w+\\s*\\/?\\s*>"),"g"),f=new RegExp("^<".concat(l.skipOpeningBracket?"?":"","\\s*\\/?\\s*[").concat(c,"]+[-").concat(c,"]*\\s*\\/?\\s*>"),"g"),p=new RegExp("^<".concat(l.skipOpeningBracket?"?":"").concat(u,"\\w+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),m=new RegExp("^<".concat(l.skipOpeningBracket?"?":"").concat(u,"[").concat(c,"]+[-").concat(c,"]*\\s+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),a=new RegExp("^<".concat(l.skipOpeningBracket?"?\\/?":"","(").concat(u,"[").concat(c,"]+)+").concat(u,"[\\\\/=>]"),""),b=new RegExp("^\\/\\s*\\w+s*>"),d=t?e.slice(t):e,w=M(e,t),$=!1,h=!1,y={cb:X,i:!0,trimCharsBeforeMatching:["/",T,"!"," "," ","\n","\r"]};return l.allowCustomTagNames?((l.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[M(e,w)]==="<")||d[0]==="<"&&((v=d[1])!=null&&v.trim()))&&(a.test(d)||/^<\w+$/.test(d))||s.test(d)&&N(e,t)||o.test(d)||f.test(d)&&N(e,t)||m.test(d)||e[t]==="/"&&e[w]!=="<"&&b.test(d))&&(h=!0):(((l.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[M(e,w)]==="<")||(d[0]==="<"||d[0]==="/"&&(!e[w]||e[w]!=="<"))&&((A=d[1])!=null&&A.trim()))&&a.test(d)||i.test(d)&&N(e,t)||r.test(d)||g.test(d)&&N(e,t)||p.test(d))&&($=!0),$&&G(e,t,I,{cb:R=>{var V;return R===void 0?((e[t]==="<"&&((V=e[t+1])!=null&&V.trim())||e[t-1]==="<")&&(h=!0),!0):R.toUpperCase()===R.toLowerCase()&&!/\d/.test(R)&&R!=="="},i:!0,trimCharsBeforeMatching:["<","/",T,"!"," "," ","\n","\r"]})&&(h=!0)),!h&&e[t]==="<"&&((E=e[t+1])!=null&&E.trim())&&Z(e,t,I,y)&&(h=!0),typeof e=="string"&&t<e.length&&h}return ae(be);})();
|
|
10
|
+
"use strict";var isHtmlTagOpening=(()=>{var B=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var X=Object.getOwnPropertyNames,V=Object.getOwnPropertySymbols;var F=Object.prototype.hasOwnProperty,ee=Object.prototype.propertyIsEnumerable;var _=(e,t,r)=>t in e?B(e,t,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[t]=r,C=(e,t)=>{for(var r in t||(t={}))F.call(t,r)&&_(e,r,t[r]);if(V)for(var r of V(t))ee.call(t,r)&&_(e,r,t[r]);return e};var te=(e,t)=>{for(var r in t)B(e,r,{get:t[r],enumerable:!0})},re=(e,t,r,i)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of X(t))!F.call(e,s)&&s!==r&&B(e,s,{get:()=>t[s],enumerable:!(i=Y(t,s))||i.enumerable});return e};var ne=e=>re(B({},"__esModule",{value:!0}),e);var ge={};te(ge,{defaults:()=>N,isOpening:()=>he,version:()=>pe});function ie(){let e=[],t=0,r=!1;return{append(i){return r?!1:t+i.length>1999?(e.push("\u2026"),t+=1,r=!0,!1):(e.push(i),t+=i.length,!0)},result(){return e.join("")},stopped(){return r}}}function se(e){return"\\u".concat(e.toString(16).padStart(4,"0"))}function L(e,t){if(e.append('"')){for(let r=0;r<t.length&&!e.stopped();r+=1){let i=t.charCodeAt(r);i===34?e.append('\\"'):i===92?e.append("\\\\"):i===8?e.append("\\b"):i===9?e.append("\\t"):i===10?e.append("\\n"):i===12?e.append("\\f"):i===13?e.append("\\r"):i<32||i===8232||i===8233||i>=55296&&i<=57343?e.append(se(i)):e.append(t[r])}e.append('"')}}function oe(e){return e.get&&e.set?"[Getter/Setter]":e.get?"[Getter]":e.set?"[Setter]":"[Accessor]"}function P(e,t){e.append("Symbol(");let r=String(t);r.length>8&&L(e,r.slice(7,-1)),e.append(")")}function H(e,t){typeof t=="symbol"?P(e,t):L(e,String(t))}function O(e,t=0){let r=ie(),i=t===4?4:0,s=new WeakSet,o=0;function m(n){i&&r.append(" ".repeat(n*i))}function l(n,a){n&&r.append(","),i&&(r.append("\n"),m(a+1))}function d(n,a,u){i&&a&&(r.append("\n"),m(u)),r.append(n)}function b(n,a){Object.prototype.hasOwnProperty.call(n,"value")?h(n.value,a):r.append(oe(n))}function $(n,a){let u;try{u=Reflect.getOwnPropertyDescriptor(n,"length")}catch(f){r.append("[Uninspectable]");return}let c=u==null?void 0:u.value;if(!Number.isSafeInteger(c)||c<0){r.append("[Uninspectable]");return}r.append("[");let g=!1;for(let f=0;f<c&&!r.stopped();f+=1){if(l(g,a),g=!0,o>=50){r.append("[MaxEntries]");break}o+=1;let p;try{p=Reflect.getOwnPropertyDescriptor(n,String(f))}catch(k){r.append("[Uninspectable]");continue}p!=null&&p.enumerable?b(p,a+1):r.append("[Empty]")}d("]",g,a)}function y(n,a){let u;try{u=Reflect.ownKeys(n)}catch(g){r.append("[Uninspectable]");return}r.append("{");let c=!1;for(let g of u){if(r.stopped())break;if(o>=50){l(c,a),c=!0,L(r,"\u2026"),r.append(i?": ":":"),r.append("[MaxEntries]");break}o+=1;let f;try{f=Reflect.getOwnPropertyDescriptor(n,g)}catch(p){l(c,a),c=!0,H(r,g),r.append(i?": ":":"),r.append("[Uninspectable]");continue}f!=null&&f.enumerable&&(l(c,a),c=!0,H(r,g),r.append(i?": ":":"),b(f,a+1))}d("}",c,a)}function w(n,a){if(s.has(n)){r.append("[Circular]");return}if(a>=5){r.append("[MaxDepth]");return}let u;try{u=Array.isArray(n)}catch(c){r.append("[Uninspectable]");return}s.add(n);try{u?$(n,a):y(n,a)}finally{s.delete(n)}}function h(n,a){n===null?r.append("null"):typeof n=="string"?L(r,n):typeof n=="number"?r.append(Object.is(n,-0)?"-0":String(n)):typeof n=="boolean"?r.append(n?"true":"false"):typeof n>"u"?r.append("undefined"):typeof n=="bigint"?r.append("".concat(n,"n")):typeof n=="symbol"?P(r,n):typeof n=="function"?r.append("[Function]"):w(n,a)}try{return h(e,0),r.result()}catch(n){return"[Uninspectable]"}}var be=new Set([..."\u060B$\u20BC\u17DB\xA5\u20A1\u20B1\xA3\u20AC\xA2\u20B9\uFDFC\u20AA\u20A9\u20AD\u20A8\u20AE\u20A6\u20BD\u20AB\u0E3F\u20A9\u20BA\u20B4","$U","$b","B/.","BZ$","Br","Bs","C$","CHF","Ft","Gs","J$","KM","K\u010D","L","MT","NT$","P","Q","R","R$","RD$","RM","Rp","S","S/.","TT$","Z$","kn","kr","lei","z\u0142","\u0192","\u0414\u0438\u043D.","\u0434\u0435\u043D","\u043B\u0432","\u062F.\u0625","Lek"]),le=Object.prototype.hasOwnProperty;function E(e){if(e==null||typeof e!="object")return!1;let t=Object.getPrototypeOf(e);return t!==null&&t!==Object.prototype&&Object.getPrototypeOf(t)!==null?!1:!(Symbol.iterator in e)&&!(Symbol.toStringTag in e)}function M(e){return typeof e=="string"}function q(e,t){return E(e)&&M(t)&&le.call(e,t)}var I="\xA0";function ae({str:e,idx:t,stopAtNewlines:r,stopAtRawNbsp:i}){if(typeof e!="string"||!e.length||((!t||typeof t!="number")&&(t=0),t<1))return null;if(e[~-t]&&(e[~-t].trim()||r&&"\n\r".includes(e[~-t])||i&&e[~-t]===I))return~-t;if(e[t-2]&&(e[t-2].trim()||r&&"\n\r".includes(e[t-2])||i&&e[t-2]===I))return t-2;for(let s=t;s--;)if(e[s]&&(e[s].trim()||r&&"\n\r".includes(e[s])||i&&e[s]===I))return s;return null}function D(e,t=0){return ae({str:e,idx:t,stopAtNewlines:!1,stopAtRawNbsp:!1})}function U(e){return typeof e!="string"?e:e.length?[e]:[]}var Q={cb:void 0,i:!1,trimBeforeMatching:!1,trimCharsBeforeMatching:[],maxMismatches:0,firstMustMatch:!1,lastMustMatch:!1,hungry:!1},ue=e=>e+1;function fe(e,t,r,i,s=!1,o=ue){var f;let m=typeof r=="function"?r():r;if(+t<0&&s&&m==="EOL")return m;let l=C(C({},Q),i);if(t>=e.length&&!s)return!1;let d=s?1:r.length,b=0,$=!1,y=!1,w=!1,h=l.maxMismatches,n=t,a=!1,u=!1,c=!1;function g(){return b===1&&h<l.maxMismatches-1}for(;e[n];){let p=o(n);if(l.trimBeforeMatching&&e[n].trim()===""){if(!e[p]&&s&&r==="EOL")return!0;n=o(n);continue}if(l&&!l.i&&((f=l==null?void 0:l.trimCharsBeforeMatching)!=null&&f.includes(e[n]))||l!=null&&l.i&&l.trimCharsBeforeMatching&&l.trimCharsBeforeMatching.map(A=>A.toLowerCase()).includes(e[n].toLowerCase())){if(s&&r==="EOL"&&!e[p])return!0;n=o(n);continue}let k=p>n?r[r.length-d]:r[d-1];if(!l.i&&e[n]===k||l.i&&k!==void 0&&e[n].toLowerCase()===k.toLowerCase()){if(a||(a=!0),w||(w=!0),d===r.length){if(u=!0,h!==l.maxMismatches)return!1}else d===1&&(c=!0);if(d-=1,b++,g())return!1;if(!d)return b!==r.length||h===l.maxMismatches||!$?n:!1}else if(!$&&!b&&($=!0),l.maxMismatches&&h&&n){h-=1;for(let A=0;A<=h;A++){let v=p>n?r[r.length-d+1+A]:r[d-2-A],R=e[o(n)];if(v&&(!l.i&&e[n]===v||l.i&&e[n].toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||d!==r.length)){if(b++,g())return!1;d-=2,a=!0;break}else if(R&&v&&(!l.i&&R===v||l.i&&R.toLowerCase()===v.toLowerCase())&&(!l.firstMustMatch||d!==r.length)){if(!b&&!l.hungry)return!1;d-=1,a=!0;break}else if(v===void 0&&h>=0&&a&&(!l.firstMustMatch||u)&&(!l.lastMustMatch||c))return n}a||(y=n)}else return n===0&&d===1&&!l.lastMustMatch&&w?0:!1;if(y!==!1&&y!==n&&(y=!1),d<1)return n;n=o(n)}if(d>0)return s&&m==="EOL"?!0:l&&l.maxMismatches>=d&&w?y||0:!1}function z(e,t,r,i,s){var $,y,w;if(E(s)&&q(s,"trimBeforeMatching")&&s&&typeof s.trimBeforeMatching!="boolean")throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_01] opts.trimBeforeMatching should be boolean!").concat(Array.isArray(s.trimBeforeMatching)?" Did you mean to use opts.trimCharsBeforeMatching?":""));let o=C(C({},Q),s);if(typeof o.trimCharsBeforeMatching=="string"&&(o.trimCharsBeforeMatching=U(o.trimCharsBeforeMatching)),o.trimCharsBeforeMatching=o.trimCharsBeforeMatching.map(h=>M(h)?h:String(h)),!M(t)||!t.length)return!1;if(!Number.isInteger(r)||r<0)throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_02] the second argument should be a natural number. Currently it's of a type: ").concat(typeof r,", equal to:\n").concat(O(r,4)));let m,l;if(M(i))m=[i];else if(Array.isArray(i))m=i;else if(!i)m=i;else if(typeof i=="function")m=[],m.push(i);else throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_03] the third argument, whatToMatch, is neither string nor array of strings! It's ").concat(typeof i,", equal to:\n").concat(O(i,4)));if(s&&!E(s))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_04] the fourth argument, options object, should be a plain object. Currently it's of a type \"").concat(typeof s,'", and equal to:\n').concat(O(s,4)));let d=0,b="";if(($=o==null?void 0:o.trimCharsBeforeMatching)!=null&&$.some((h,n)=>h.length>1?(d=n,b=h,!0):!1))throw new Error("string-match-left-right/".concat(e,"(): [THROW_ID_05] the fourth argument, options object contains trimCharsBeforeMatching. It was meant to list the single characters but one of the entries at index ").concat(d," is longer than 1 character, ").concat(b.length," (equals to ").concat(b,"). Please split it into separate characters and put into array as separate elements."));if(!m||!Array.isArray(m)||Array.isArray(m)&&!m.length||Array.isArray(m)&&m.length===1&&M(m[0])&&!m[0].trim()){if(typeof o.cb=="function"){let n,a=r;if((e==="matchLeftIncl"||e==="matchRight")&&(a+=1),e[5]==="L")for(let f=a;f--;){let p=t[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&(p!=null&&p.trim()))&&(!((y=o.trimCharsBeforeMatching)!=null&&y.length)||p!==void 0&&!o.trimCharsBeforeMatching.includes(p))){n=f;break}}else if(e.startsWith("matchRight"))for(let f=a;f<t.length;f++){let p=t[f];if((!o.trimBeforeMatching||o.trimBeforeMatching&&p.trim())&&(!((w=o.trimCharsBeforeMatching)!=null&&w.length)||!o.trimCharsBeforeMatching.includes(p))){n=f;break}}if(n===void 0)return!1;let u=t[n],c=n+1,g="";return c&&c>0&&(g=t.slice(0,c)),e[5]==="L"||n&&n>0&&(g=t.slice(n)),o.cb(u,g,n)}let h="";throw s||(h=" More so, the whole options object, the fourth input argument, is missing!"),new Error("string-match-left-right/".concat(e,'(): [THROW_ID_06] the third argument, "whatToMatch", was given as an empty string. This means, you intend to match purely by a callback. The callback was not set though, the opts key "cb" is not set!').concat(h))}for(let h=0,n=m.length;h<n;h++){l=typeof m[h]=="function";let a=m[h],u,c,g="",f=r;e==="matchRight"?f+=1:e==="matchLeft"&&(f-=1);let p=fe(t,f,a,o,l,k=>e[5]==="L"?k-1:k+1);if(p&&l&&typeof a=="function"&&a()==="EOL")return a()&&(!o.cb||o.cb(u,g,c))?a():!1;if(Number.isInteger(p)&&(c=e.startsWith("matchLeft")?p-1:p+1,e[5]==="L"?g=t.slice(0,p):g=t.slice(c)),c<0&&(c=void 0),t[c]&&(u=t[c]),Number.isInteger(p)&&(!o.cb||o.cb(u,g,c)))return a}return!1}function J(e,t,r,i){return z("matchRightIncl",e,t,r,i)}function K(e,t,r,i){return z("matchRight",e,t,r,i)}var G="4.2.1";function S(e,t){return e[t]==="<"||e[D(e,t)]==="<"}function Z(e){return e===void 0||e.toUpperCase()===e.toLowerCase()&&!/\d/.test(e)&&e!=="="}var N={allowCustomTagNames:!1,skipOpeningBracket:!1},W="\\",T=["a","abbr","acronym","address","applet","area","article","aside","audio","b","base","basefont","bdi","bdo","big","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","data","datalist","dd","del","details","dfn","dialog","dir","div","dl","doctype","dt","em","embed","fieldset","figcaption","figure","font","footer","form","frame","frameset","h1","h1 - h6","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","iframe","img","input","ins","kbd","keygen","label","legend","li","link","main","map","mark","math","menu","menuitem","meta","meter","nav","noframes","noscript","object","ol","optgroup","option","output","p","param","picture","pre","progress","q","rb","rp","rt","rtc","ruby","s","samp","script","section","select","slot","small","source","span","strike","strong","style","sub","summary","sup","svg","table","tbody","td","template","textarea","tfoot","th","thead","time","title","tr","track","tt","u","ul","var","video","wbr","xml"];var pe=G;function he(e,t=0,r){var A,v,R;if(typeof e!="string")throw new Error('is-html-tag-opening/isOpening(): [THROW_ID_01] the first input argument should have been a string but it was given as "'.concat(typeof e,'", value being ').concat(O(e,4)));if(!Number.isInteger(t)||t<0)throw new Error('is-html-tag-opening/isOpening(): [THROW_ID_02] the second input argument should have been a natural number string index but it was given as "'.concat(typeof t,'", value being ').concat(O(t,4)));let i=C(C({},N),r),s="[\\\\ \\t\\r\\n/]*",o="._a-z0-9\xB7\xC0-\xD6\xD8-\xF6\xF8-\u037D\u037F-\u1FFF\u200C-\u200D\u203F-\u2040\u2070-\uFFFF",m=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"\\w+").concat(s,"\\/?").concat(s,">"),"g"),l=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"[").concat(o,"]+[-").concat(o,"]*").concat(s,">"),"g"),d=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\w+\\s+\\w+(?:-\\w+)?\\s*=\\s*['\"\\w]"),"g"),b=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\w+\\s+[").concat(o,"]+[-").concat(o,"]*(?:-\\w+)?\\s*=\\s*['\"\\w]")),$=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\/?\\s*\\w+\\s*\\/?\\s*>"),"g"),y=new RegExp("^<".concat(i.skipOpeningBracket?"?":"","\\s*\\/?\\s*[").concat(o,"]+[-").concat(o,"]*\\s*\\/?\\s*>"),"g"),w=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"\\w+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),h=new RegExp("^<".concat(i.skipOpeningBracket?"?":"").concat(s,"[").concat(o,"]+[-").concat(o,"]*\\s+(?:\\s*\\w+)?\\s*\\w+=['\"]"),"g"),n=new RegExp("^<".concat(i.skipOpeningBracket?"?\\/?":"","(").concat(s,"[").concat(o,"]+)+").concat(s,"[\\\\/=>]"),""),a=/^\/\s*\w+s*>/,u=t?e.slice(t):e,c=D(e,t),g=!1,f=!1,p={cb:Z,i:!0,trimCharsBeforeMatching:["/",W,"!"," "," ","\n","\r"]};return i.allowCustomTagNames?((i.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[D(e,c)]==="<")||u[0]==="<"&&((A=u[1])!=null&&A.trim()))&&(n.test(u)||/^<\w+$/.test(u))||l.test(u)&&S(e,t)||b.test(u)||y.test(u)&&S(e,t)||h.test(u)||e[t]==="/"&&e[c]!=="<"&&a.test(u))&&(f=!0):(((i.skipOpeningBracket&&(e[t-1]==="<"||e[t-1]==="/"&&e[D(e,c)]==="<")||(u[0]==="<"||u[0]==="/"&&(!e[c]||e[c]!=="<"))&&((v=u[1])!=null&&v.trim()))&&n.test(u)||m.test(u)&&S(e,t)||d.test(u)||$.test(u)&&S(e,t)||w.test(u))&&(g=!0),g&&J(e,t,T,{cb:x=>{var j;return x===void 0?((e[t]==="<"&&((j=e[t+1])!=null&&j.trim())||e[t-1]==="<")&&(f=!0),!0):x.toUpperCase()===x.toLowerCase()&&!/\d/.test(x)&&x!=="="},i:!0,trimCharsBeforeMatching:["<","/",W,"!"," "," ","\n","\r"]})&&(f=!0)),!f&&e[t]==="<"&&((R=e[t+1])!=null&&R.trim())&&K(e,t,T,p)&&(f=!0),typeof e=="string"&&t<e.length&&f}return ne(ge);})();
|
|
11
11
|
/**
|
|
12
|
-
* @name
|
|
13
|
-
* @fileoverview
|
|
14
|
-
* @version
|
|
12
|
+
* @name codsen-utils
|
|
13
|
+
* @fileoverview Various utility functions
|
|
14
|
+
* @version 1.8.0
|
|
15
15
|
* @author Roy Revelt
|
|
16
16
|
* @license MIT
|
|
17
|
-
* {@link https://codsen.com/os/
|
|
17
|
+
* {@link https://codsen.com/os/codsen-utils/}
|
|
18
18
|
*/
|
|
19
19
|
/**
|
|
20
|
-
* @name
|
|
21
|
-
* @fileoverview
|
|
22
|
-
* @version
|
|
20
|
+
* @name string-left-right
|
|
21
|
+
* @fileoverview Looks up the first non-whitespace character to the left/right of a given index
|
|
22
|
+
* @version 6.2.0
|
|
23
23
|
* @author Roy Revelt
|
|
24
24
|
* @license MIT
|
|
25
|
-
* {@link https://codsen.com/os/
|
|
25
|
+
* {@link https://codsen.com/os/string-left-right/}
|
|
26
26
|
*/
|
|
27
27
|
/**
|
|
28
|
-
* @name
|
|
29
|
-
* @fileoverview
|
|
30
|
-
* @version
|
|
28
|
+
* @name arrayiffy-if-string
|
|
29
|
+
* @fileoverview Put non-empty strings into arrays, turn empty-ones into empty arrays. Bypass everything else.
|
|
30
|
+
* @version 5.2.1
|
|
31
31
|
* @author Roy Revelt
|
|
32
32
|
* @license MIT
|
|
33
|
-
* {@link https://codsen.com/os/
|
|
33
|
+
* {@link https://codsen.com/os/arrayiffy-if-string/}
|
|
34
34
|
*/
|
|
35
35
|
/**
|
|
36
|
-
* @name string-left-right
|
|
37
|
-
* @fileoverview
|
|
38
|
-
* @version
|
|
36
|
+
* @name string-match-left-right
|
|
37
|
+
* @fileoverview Match substrings on the left or right of a given index, ignoring whitespace
|
|
38
|
+
* @version 9.2.1
|
|
39
39
|
* @author Roy Revelt
|
|
40
40
|
* @license MIT
|
|
41
|
-
* {@link https://codsen.com/os/string-left-right/}
|
|
41
|
+
* {@link https://codsen.com/os/string-match-left-right/}
|
|
42
42
|
*/
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "is-html-tag-opening",
|
|
3
|
-
"version": "4.1
|
|
3
|
+
"version": "4.2.1",
|
|
4
4
|
"description": "Does an HTML tag start at given position?",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"bracket",
|
|
@@ -37,47 +37,47 @@
|
|
|
37
37
|
},
|
|
38
38
|
"types": "types/index.d.ts",
|
|
39
39
|
"scripts": {
|
|
40
|
-
"build": "node
|
|
41
|
-
"
|
|
42
|
-
"
|
|
43
|
-
"dev": "DEV=true node '../../ops/scripts/esbuild.js' && npm run dts",
|
|
40
|
+
"build": "node ../../ops/scripts/esbuild.js && npm run dts",
|
|
41
|
+
"coverage": "c8 uvu test",
|
|
42
|
+
"dev": "node ../../ops/scripts/esbuild.js --dev && npm run dts",
|
|
44
43
|
"devtest": "c8 npm run unit && npm run examples && npm run lint",
|
|
45
|
-
"dts": "rollup -c &&
|
|
44
|
+
"dts": "rollup -c && biome format --write --config-path=../../biome.json --vcs-enabled=false --use-editorconfig=false types/index.d.ts",
|
|
46
45
|
"examples": "node '../../ops/scripts/run-examples.js'",
|
|
47
|
-
"lect": "node '../../ops/lect/lect.js'
|
|
48
|
-
"
|
|
49
|
-
"lint": "
|
|
46
|
+
"lect": "node '../../ops/lect/lect.js'",
|
|
47
|
+
"lect:check": "node '../../ops/lect/lect.js' --check",
|
|
48
|
+
"lint": "biome lint --error-on-warnings . && npm run typecheck",
|
|
49
|
+
"lint:fix": "biome lint --write --error-on-warnings . && npm run typecheck",
|
|
50
50
|
"perf": "node perf/check.js",
|
|
51
51
|
"prep": "echo 'ready'",
|
|
52
|
-
"prettier": "
|
|
53
|
-
"prettier:format": "
|
|
54
|
-
"pretest": "npm run lect && npm run build",
|
|
52
|
+
"prettier": "biome format",
|
|
53
|
+
"prettier:format": "biome format --write .",
|
|
54
|
+
"pretest": "npm run lect:check && npm run build",
|
|
55
55
|
"test": "npm run devtest",
|
|
56
|
+
"typecheck": "tsc --noEmit --pretty false --project tsconfig.json",
|
|
56
57
|
"unit": "uvu test"
|
|
57
58
|
},
|
|
58
|
-
"engines": {
|
|
59
|
-
"node": ">=14.18.0"
|
|
60
|
-
},
|
|
61
59
|
"c8": {
|
|
60
|
+
"all": true,
|
|
62
61
|
"check-coverage": true,
|
|
63
|
-
"exclude": [
|
|
64
|
-
|
|
65
|
-
],
|
|
62
|
+
"exclude": ["**/test/**/*.*"],
|
|
63
|
+
"include": ["dist/*.esm.js"],
|
|
66
64
|
"lines": 100
|
|
67
65
|
},
|
|
68
66
|
"lect": {
|
|
69
67
|
"licence": {
|
|
70
|
-
"extras": [
|
|
71
|
-
""
|
|
72
|
-
]
|
|
68
|
+
"extras": [""]
|
|
73
69
|
}
|
|
74
70
|
},
|
|
75
71
|
"dependencies": {
|
|
76
|
-
"
|
|
77
|
-
"string-
|
|
72
|
+
"codsen-utils": "^1.8.0",
|
|
73
|
+
"string-left-right": "^6.2.0",
|
|
74
|
+
"string-match-left-right": "^9.2.1"
|
|
78
75
|
},
|
|
79
76
|
"devDependencies": {
|
|
80
|
-
"test-mixer": "^4.
|
|
77
|
+
"test-mixer": "^4.3.0"
|
|
78
|
+
},
|
|
79
|
+
"engines": {
|
|
80
|
+
"node": ">=18.20.8"
|
|
81
81
|
},
|
|
82
82
|
"publishConfig": {
|
|
83
83
|
"registry": "https://registry.npmjs.org/"
|