@openclaw/matrix 2026.6.33 → 2026.6.35
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/dist/api.js +4 -4
- package/dist/{approval-handler.runtime-Zq8FeqLy.js → approval-handler.runtime-BjBtbrdi.js} +4 -4
- package/dist/{approval-ids-gM2AFaP-.js → approval-ids-D_MGByp6.js} +1 -1
- package/dist/{approval-reaction-auth--lKUos8v.js → approval-reaction-auth-DTQnRx4G.js} +2 -2
- package/dist/{channel-QIfssnwm.js → channel-R4ZIKMwT.js} +16 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-DkbZfBYE.js → channel.runtime-HNV3MjVm.js} +6 -6
- package/dist/{cli-ZiO7g1vT.js → cli-Dpi-JiMX.js} +9 -9
- package/dist/{cli-metadata-Cn_UFU3u.js → cli-metadata-CQ0Fu1Zr.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-COdtuzoa.js → client-BtISa2BM.js} +2 -2
- package/dist/{client-bootstrap-DoOOMP52.js → client-bootstrap-Cp6Nwuoi.js} +1 -1
- package/dist/{client-DnNqVfCX.js → client-rYWNQvAN.js} +2 -2
- package/dist/{config-schema-o1UmRtMF.js → config-schema-BcOo_2Py.js} +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/{create-client-DWe5jGGk.js → create-client-Cy0BcHFg.js} +2 -2
- package/dist/{crypto-runtime-DaHFPR8x.js → crypto-runtime-e0bRP6dB.js} +55 -10
- package/dist/{deps-BVWGd2XS.js → deps-DoQ5mpwP.js} +20 -2
- package/dist/{directory-live-D4ibL3X0.js → directory-live-CJzQ5za7.js} +2 -2
- package/dist/{doctor-BwpkOBwr.js → doctor-wP-H47UF.js} +1 -1
- package/dist/{draft-stream-aZa1gWNI.js → draft-stream-C4X8Txw_.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{legacy-crypto-inspector-tJOj25VL.js → legacy-crypto-inspector-Dl4lMAei.js} +1 -1
- package/dist/{matrix-migration.runtime-dvxE3e5l.js → matrix-migration.runtime-BQ69V3CR.js} +1 -1
- package/dist/{media-text-DS2lvlA2.js → media-text-BkdnLpBE.js} +1 -1
- package/dist/{messages-CMTiMecS.js → messages-BFuuCO_k.js} +4 -3
- package/dist/{monitor-DAHAvlEh.js → monitor-BIXV9yRC.js} +21 -18
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-HSFW4DUU.js +3 -0
- package/dist/{profile-update-DUh6sAqK.js → profile-update-sMwJwi8I.js} +2 -2
- package/dist/{reaction-events-CABcpM-q.js → reaction-events-C690uBKS.js} +1 -1
- package/dist/{resolve-targets-Byrcsv59.js → resolve-targets-CwHoq7hn.js} +1 -1
- package/dist/{resolver.runtime-Blu9khLB.js → resolver.runtime-C_uuPsry.js} +1 -1
- package/dist/runtime-api.js +1 -1
- package/dist/runtime-heavy-api.js +1 -1
- package/dist/{sdk-CpYofZkF.js → sdk-DaHsa7DR.js} +2 -2
- package/dist/{send-eoayPB_l.js → send-BMwJ5LY2.js} +1 -1
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-DRzRwu9E.js → setup-bootstrap-D8DQwEcO.js} +2 -2
- package/dist/{setup-core-Ub_idsu1.js → setup-core-CVo-64kh.js} +1 -1
- package/dist/setup-plugin-api.js +3 -3
- package/dist/{setup-surface-CXenmuMm.js → setup-surface-Du6-iuN4.js} +5 -5
- package/dist/{shared-CSN0TWWD.js → shared-QI0RpVnw.js} +2 -2
- package/dist/{thread-bindings-DuoPRata.js → thread-bindings-d512FOPe.js} +1 -1
- package/dist/{tool-actions.runtime-BwP9E9M0.js → tool-actions.runtime-CuxC5hpa.js} +7 -6
- package/dist/{verification-BN8M6A73.js → verification-DBPeo1wO.js} +1 -1
- package/node_modules/linkify-it/README.md +3 -4
- package/node_modules/linkify-it/build/index.cjs.js +44 -41
- package/node_modules/linkify-it/index.mjs +10 -11
- package/node_modules/linkify-it/lib/re.mjs +34 -30
- package/node_modules/linkify-it/package.json +10 -15
- package/node_modules/markdown-it/dist/index.cjs.js +3652 -5378
- package/node_modules/markdown-it/dist/index.cjs.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.js +1399 -4479
- package/node_modules/markdown-it/dist/markdown-it.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.min.js +3 -2
- package/node_modules/markdown-it/dist/markdown-it.min.js.map +1 -0
- package/node_modules/markdown-it/lib/common/html_re.mjs +9 -9
- package/node_modules/markdown-it/lib/common/utils.mjs +2 -11
- package/node_modules/markdown-it/lib/parser_block.mjs +9 -9
- package/node_modules/markdown-it/lib/parser_core.mjs +7 -7
- package/node_modules/markdown-it/lib/parser_inline.mjs +16 -16
- package/node_modules/markdown-it/lib/renderer.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/code.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/fence.mjs +4 -4
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +7 -7
- package/node_modules/markdown-it/lib/rules_block/hr.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +8 -8
- package/node_modules/markdown-it/lib/rules_block/list.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +5 -5
- package/node_modules/markdown-it/lib/rules_block/reference.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_block/state_block.mjs +6 -6
- package/node_modules/markdown-it/lib/rules_block/table.mjs +4 -4
- package/node_modules/markdown-it/lib/rules_core/block.mjs +3 -3
- package/node_modules/markdown-it/lib/rules_core/linkify.mjs +15 -15
- package/node_modules/markdown-it/lib/rules_core/normalize.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +17 -17
- package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +8 -8
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +7 -7
- package/node_modules/markdown-it/lib/rules_inline/escape.mjs +15 -1
- package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_inline/link.mjs +1 -1
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +2 -2
- package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +10 -10
- package/node_modules/markdown-it/lib/token.mjs +12 -12
- package/node_modules/markdown-it/package.json +25 -34
- package/npm-shrinkwrap.json +12 -12
- package/package.json +5 -5
- package/dist/probe.runtime-DKRqRegP.js +0 -3
|
@@ -24,7 +24,7 @@ function reFactory (opts) {
|
|
|
24
24
|
// All possible word characters (everything without punctuation, spaces & controls)
|
|
25
25
|
// Defined via punctuation & spaces to save space
|
|
26
26
|
// Should be something like \p{\L\N\S\M} (\w but without `_`)
|
|
27
|
-
re.src_pseudo_letter =
|
|
27
|
+
re.src_pseudo_letter = `(?:(?!${text_separators}|${re.src_ZPCc})${re.src_Any})`;
|
|
28
28
|
// The same as abothe but without [0-9]
|
|
29
29
|
// var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
|
|
30
30
|
|
|
@@ -33,7 +33,9 @@ function reFactory (opts) {
|
|
|
33
33
|
'(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)';
|
|
34
34
|
|
|
35
35
|
// Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
|
|
36
|
-
|
|
36
|
+
// Length is capped to exclude possible rescans till the end and avoid O(n^2)
|
|
37
|
+
// DoS. No standard limit, just take something reasonable.
|
|
38
|
+
re.src_auth = `(?:(?:(?!${re.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`;
|
|
37
39
|
|
|
38
40
|
re.src_port =
|
|
39
41
|
|
|
@@ -41,23 +43,23 @@ function reFactory (opts) {
|
|
|
41
43
|
|
|
42
44
|
re.src_host_terminator =
|
|
43
45
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
+
`(?=$|${text_separators}|${re.src_ZPCc})` +
|
|
47
|
+
`(?!${opts['---'] ? '-(?!--)|' : '-|'}_|:\\d|\\.-|\\.(?!$|${re.src_ZPCc}))`;
|
|
46
48
|
|
|
47
49
|
re.src_path =
|
|
48
50
|
|
|
49
51
|
'(?:' +
|
|
50
52
|
'[/?#]' +
|
|
51
53
|
'(?:' +
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
`(?!${re.src_ZCc}|${text_separators}|[()[\\]{}.,"'?!\\-;]).|` +
|
|
55
|
+
`\\[(?:(?!${re.src_ZCc}|\\]).)*\\]|` +
|
|
56
|
+
`\\((?:(?!${re.src_ZCc}|[)]).)*\\)|` +
|
|
57
|
+
`\\{(?:(?!${re.src_ZCc}|[}]).)*\\}|` +
|
|
58
|
+
`\\"(?:(?!${re.src_ZCc}|["]).)+\\"|` +
|
|
59
|
+
`\\'(?:(?!${re.src_ZCc}|[']).)+\\'|` +
|
|
58
60
|
|
|
59
61
|
// allow `I'm_king` if no pair found
|
|
60
|
-
|
|
62
|
+
`\\'(?=${re.src_pseudo_letter}|[-])|` +
|
|
61
63
|
|
|
62
64
|
// google has many dots in "google search" links (#66, #81).
|
|
63
65
|
// github has ... in commit range links,
|
|
@@ -69,30 +71,32 @@ function reFactory (opts) {
|
|
|
69
71
|
// until more examples found.
|
|
70
72
|
'\\.{2,}[a-zA-Z0-9%/&]|' +
|
|
71
73
|
|
|
72
|
-
|
|
74
|
+
`\\.(?!${re.src_ZCc}|[.]|$)|` +
|
|
73
75
|
(opts['---']
|
|
74
76
|
? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
|
|
75
77
|
: '\\-+|'
|
|
76
78
|
) +
|
|
77
79
|
// allow `,,,` in paths
|
|
78
|
-
|
|
80
|
+
`,(?!${re.src_ZCc}|$)|` +
|
|
79
81
|
|
|
80
82
|
// allow `;` if not followed by space-like char
|
|
81
|
-
|
|
83
|
+
`;(?!${re.src_ZCc}|$)|` +
|
|
82
84
|
|
|
83
85
|
// allow `!!!` in paths, but not at the end
|
|
84
|
-
|
|
86
|
+
`\\!+(?!${re.src_ZCc}|[!]|$)|` +
|
|
85
87
|
|
|
86
|
-
|
|
88
|
+
`\\?(?!${re.src_ZCc}|[?]|$)` +
|
|
87
89
|
')+' +
|
|
88
90
|
'|\\/' +
|
|
89
91
|
')?';
|
|
90
92
|
|
|
91
93
|
// Allow anything in markdown spec, forbid quote (") at the first position
|
|
92
94
|
// because emails enclosed in quotes are far more common
|
|
95
|
+
// Max name length capped to 64 chars (RFC 5321). This also prevents O(n^2)
|
|
96
|
+
// rescans to the end on inputs like `mailto:mailto:...`
|
|
93
97
|
re.src_email_name =
|
|
94
98
|
|
|
95
|
-
'[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]
|
|
99
|
+
'[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}';
|
|
96
100
|
|
|
97
101
|
re.src_xn =
|
|
98
102
|
|
|
@@ -107,7 +111,7 @@ function reFactory (opts) {
|
|
|
107
111
|
'(?:' +
|
|
108
112
|
re.src_xn +
|
|
109
113
|
'|' +
|
|
110
|
-
re.src_pseudo_letter
|
|
114
|
+
`${re.src_pseudo_letter}{1,63}` +
|
|
111
115
|
')';
|
|
112
116
|
|
|
113
117
|
re.src_domain =
|
|
@@ -115,9 +119,9 @@ function reFactory (opts) {
|
|
|
115
119
|
'(?:' +
|
|
116
120
|
re.src_xn +
|
|
117
121
|
'|' +
|
|
118
|
-
|
|
122
|
+
`(?:${re.src_pseudo_letter})` +
|
|
119
123
|
'|' +
|
|
120
|
-
|
|
124
|
+
`(?:${re.src_pseudo_letter}(?:-|${re.src_pseudo_letter}){0,61}${re.src_pseudo_letter})` +
|
|
121
125
|
')';
|
|
122
126
|
|
|
123
127
|
re.src_host =
|
|
@@ -126,7 +130,7 @@ function reFactory (opts) {
|
|
|
126
130
|
// Don't need IP check, because digits are already allowed in normal domain names
|
|
127
131
|
// src_ip4 +
|
|
128
132
|
// '|' +
|
|
129
|
-
|
|
133
|
+
`(?:(?:(?:${re.src_domain})\\.)*${re.src_domain})`/* _root */ +
|
|
130
134
|
')';
|
|
131
135
|
|
|
132
136
|
re.tpl_host_fuzzy =
|
|
@@ -134,12 +138,12 @@ function reFactory (opts) {
|
|
|
134
138
|
'(?:' +
|
|
135
139
|
re.src_ip4 +
|
|
136
140
|
'|' +
|
|
137
|
-
|
|
141
|
+
`(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))` +
|
|
138
142
|
')';
|
|
139
143
|
|
|
140
144
|
re.tpl_host_no_ip_fuzzy =
|
|
141
145
|
|
|
142
|
-
|
|
146
|
+
`(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))`;
|
|
143
147
|
|
|
144
148
|
re.src_host_strict =
|
|
145
149
|
|
|
@@ -168,24 +172,24 @@ function reFactory (opts) {
|
|
|
168
172
|
// Rude test fuzzy links by host, for quick deny
|
|
169
173
|
re.tpl_host_fuzzy_test =
|
|
170
174
|
|
|
171
|
-
|
|
175
|
+
`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${re.src_ZPCc}|>|$))`;
|
|
172
176
|
|
|
173
177
|
re.tpl_email_fuzzy =
|
|
174
178
|
|
|
175
|
-
|
|
176
|
-
|
|
179
|
+
`(^|${text_separators}|"|\\(|${re.src_ZCc})` +
|
|
180
|
+
`(${re.src_email_name}@${re.tpl_host_fuzzy_strict})`;
|
|
177
181
|
|
|
178
182
|
re.tpl_link_fuzzy =
|
|
179
183
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
180
184
|
// but can start with > (markdown blockquote)
|
|
181
|
-
|
|
182
|
-
|
|
185
|
+
`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${re.src_ZPCc}))` +
|
|
186
|
+
`((?![$+<=>^\`|\uff5c])${re.tpl_host_port_fuzzy_strict}${re.src_path})`;
|
|
183
187
|
|
|
184
188
|
re.tpl_link_no_ip_fuzzy =
|
|
185
189
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
186
190
|
// but can start with > (markdown blockquote)
|
|
187
|
-
|
|
188
|
-
|
|
191
|
+
`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${re.src_ZPCc}))` +
|
|
192
|
+
`((?![$+<=>^\`|\uff5c])${re.tpl_host_port_no_ip_fuzzy_strict}${re.src_path})`;
|
|
189
193
|
|
|
190
194
|
return re
|
|
191
195
|
}
|
|
@@ -241,7 +245,7 @@ const defaultSchemas = {
|
|
|
241
245
|
if (!self.re.http) {
|
|
242
246
|
// compile lazily, because "host"-containing variables can change on tlds update.
|
|
243
247
|
self.re.http = new RegExp(
|
|
244
|
-
|
|
248
|
+
`^\\/\\/${self.re.src_auth}${self.re.src_host_port_strict}${self.re.src_path}`, 'i'
|
|
245
249
|
);
|
|
246
250
|
}
|
|
247
251
|
if (self.re.http.test(tail)) {
|
|
@@ -263,7 +267,7 @@ const defaultSchemas = {
|
|
|
263
267
|
self.re.src_auth +
|
|
264
268
|
// Don't allow single-level domains, because of false positives like '//test'
|
|
265
269
|
// with code comments
|
|
266
|
-
|
|
270
|
+
`(?:localhost|(?:(?:${self.re.src_domain})\\.)+${self.re.src_domain_root})` +
|
|
267
271
|
self.re.src_port +
|
|
268
272
|
self.re.src_host_terminator +
|
|
269
273
|
self.re.src_path,
|
|
@@ -287,7 +291,7 @@ const defaultSchemas = {
|
|
|
287
291
|
|
|
288
292
|
if (!self.re.mailto) {
|
|
289
293
|
self.re.mailto = new RegExp(
|
|
290
|
-
|
|
294
|
+
`^${self.re.src_email_name}@${self.re.src_host_strict}`, 'i'
|
|
291
295
|
);
|
|
292
296
|
}
|
|
293
297
|
if (self.re.mailto.test(tail)) {
|
|
@@ -299,7 +303,6 @@ const defaultSchemas = {
|
|
|
299
303
|
};
|
|
300
304
|
|
|
301
305
|
// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
|
|
302
|
-
/* eslint-disable-next-line max-len */
|
|
303
306
|
const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]';
|
|
304
307
|
|
|
305
308
|
// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
|
|
@@ -359,7 +362,7 @@ function compile (self) {
|
|
|
359
362
|
self.__compiled__ = {}; // Reset compiled data
|
|
360
363
|
|
|
361
364
|
function schemaError (name, val) {
|
|
362
|
-
throw new Error(
|
|
365
|
+
throw new Error(`(LinkifyIt) Invalid schema "${name}": ${val}`)
|
|
363
366
|
}
|
|
364
367
|
|
|
365
368
|
Object.keys(self.__schemas__).forEach(function (name) {
|
|
@@ -433,12 +436,12 @@ function compile (self) {
|
|
|
433
436
|
.map(escapeRE)
|
|
434
437
|
.join('|');
|
|
435
438
|
// (?!_) cause 1.5x slowdown
|
|
436
|
-
self.re.schema_test = RegExp(
|
|
437
|
-
self.re.schema_search = RegExp(
|
|
438
|
-
self.re.schema_at_start = RegExp(
|
|
439
|
+
self.re.schema_test = RegExp(`(^|(?!_)(?:[><\uff5c]|${re.src_ZPCc}))(${slist})`, 'i');
|
|
440
|
+
self.re.schema_search = RegExp(`(^|(?!_)(?:[><\uff5c]|${re.src_ZPCc}))(${slist})`, 'ig');
|
|
441
|
+
self.re.schema_at_start = RegExp(`^${self.re.schema_search.source}`, 'i');
|
|
439
442
|
|
|
440
443
|
self.re.pretest = RegExp(
|
|
441
|
-
|
|
444
|
+
`(${self.re.schema_test.source})|(${self.re.host_fuzzy_test.source})|@`,
|
|
442
445
|
'i'
|
|
443
446
|
);
|
|
444
447
|
}
|
|
@@ -819,10 +822,10 @@ LinkifyIt.prototype.normalize = function normalize (match) {
|
|
|
819
822
|
// Do minimal possible changes by default. Need to collect feedback prior
|
|
820
823
|
// to move forward https://github.com/markdown-it/linkify-it/issues/1
|
|
821
824
|
|
|
822
|
-
if (!match.schema) { match.url =
|
|
825
|
+
if (!match.schema) { match.url = `http://${match.url}`; }
|
|
823
826
|
|
|
824
827
|
if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
|
|
825
|
-
match.url =
|
|
828
|
+
match.url = `mailto:${match.url}`;
|
|
826
829
|
}
|
|
827
830
|
};
|
|
828
831
|
|
|
@@ -51,7 +51,7 @@ const defaultSchemas = {
|
|
|
51
51
|
if (!self.re.http) {
|
|
52
52
|
// compile lazily, because "host"-containing variables can change on tlds update.
|
|
53
53
|
self.re.http = new RegExp(
|
|
54
|
-
|
|
54
|
+
`^\\/\\/${self.re.src_auth}${self.re.src_host_port_strict}${self.re.src_path}`, 'i'
|
|
55
55
|
)
|
|
56
56
|
}
|
|
57
57
|
if (self.re.http.test(tail)) {
|
|
@@ -73,7 +73,7 @@ const defaultSchemas = {
|
|
|
73
73
|
self.re.src_auth +
|
|
74
74
|
// Don't allow single-level domains, because of false positives like '//test'
|
|
75
75
|
// with code comments
|
|
76
|
-
|
|
76
|
+
`(?:localhost|(?:(?:${self.re.src_domain})\\.)+${self.re.src_domain_root})` +
|
|
77
77
|
self.re.src_port +
|
|
78
78
|
self.re.src_host_terminator +
|
|
79
79
|
self.re.src_path,
|
|
@@ -97,7 +97,7 @@ const defaultSchemas = {
|
|
|
97
97
|
|
|
98
98
|
if (!self.re.mailto) {
|
|
99
99
|
self.re.mailto = new RegExp(
|
|
100
|
-
|
|
100
|
+
`^${self.re.src_email_name}@${self.re.src_host_strict}`, 'i'
|
|
101
101
|
)
|
|
102
102
|
}
|
|
103
103
|
if (self.re.mailto.test(tail)) {
|
|
@@ -109,7 +109,6 @@ const defaultSchemas = {
|
|
|
109
109
|
}
|
|
110
110
|
|
|
111
111
|
// RE pattern for 2-character tlds (autogenerated by ./support/tlds_2char_gen.js)
|
|
112
|
-
/* eslint-disable-next-line max-len */
|
|
113
112
|
const tlds_2ch_src_re = 'a[cdefgilmnoqrstuwxz]|b[abdefghijmnorstvwyz]|c[acdfghiklmnoruvwxyz]|d[ejkmoz]|e[cegrstu]|f[ijkmor]|g[abdefghilmnpqrstuwy]|h[kmnrtu]|i[delmnoqrst]|j[emop]|k[eghimnprwyz]|l[abcikrstuvy]|m[acdeghklmnopqrstuvwxyz]|n[acefgilopruz]|om|p[aefghklmnrstwy]|qa|r[eosuw]|s[abcdeghijklmnortuvxyz]|t[cdfghjklmnortvwz]|u[agksyz]|v[aceginu]|w[fs]|y[et]|z[amw]'
|
|
114
113
|
|
|
115
114
|
// DON'T try to make PRs with changes. Extend TLDs with LinkifyIt.tlds() instead
|
|
@@ -169,7 +168,7 @@ function compile (self) {
|
|
|
169
168
|
self.__compiled__ = {} // Reset compiled data
|
|
170
169
|
|
|
171
170
|
function schemaError (name, val) {
|
|
172
|
-
throw new Error(
|
|
171
|
+
throw new Error(`(LinkifyIt) Invalid schema "${name}": ${val}`)
|
|
173
172
|
}
|
|
174
173
|
|
|
175
174
|
Object.keys(self.__schemas__).forEach(function (name) {
|
|
@@ -243,12 +242,12 @@ function compile (self) {
|
|
|
243
242
|
.map(escapeRE)
|
|
244
243
|
.join('|')
|
|
245
244
|
// (?!_) cause 1.5x slowdown
|
|
246
|
-
self.re.schema_test = RegExp(
|
|
247
|
-
self.re.schema_search = RegExp(
|
|
248
|
-
self.re.schema_at_start = RegExp(
|
|
245
|
+
self.re.schema_test = RegExp(`(^|(?!_)(?:[><\uff5c]|${re.src_ZPCc}))(${slist})`, 'i')
|
|
246
|
+
self.re.schema_search = RegExp(`(^|(?!_)(?:[><\uff5c]|${re.src_ZPCc}))(${slist})`, 'ig')
|
|
247
|
+
self.re.schema_at_start = RegExp(`^${self.re.schema_search.source}`, 'i')
|
|
249
248
|
|
|
250
249
|
self.re.pretest = RegExp(
|
|
251
|
-
|
|
250
|
+
`(${self.re.schema_test.source})|(${self.re.host_fuzzy_test.source})|@`,
|
|
252
251
|
'i'
|
|
253
252
|
)
|
|
254
253
|
}
|
|
@@ -629,10 +628,10 @@ LinkifyIt.prototype.normalize = function normalize (match) {
|
|
|
629
628
|
// Do minimal possible changes by default. Need to collect feedback prior
|
|
630
629
|
// to move forward https://github.com/markdown-it/linkify-it/issues/1
|
|
631
630
|
|
|
632
|
-
if (!match.schema) { match.url =
|
|
631
|
+
if (!match.schema) { match.url = `http://${match.url}` }
|
|
633
632
|
|
|
634
633
|
if (match.schema === 'mailto:' && !/^mailto:/i.test(match.url)) {
|
|
635
|
-
match.url =
|
|
634
|
+
match.url = `mailto:${match.url}`
|
|
636
635
|
}
|
|
637
636
|
}
|
|
638
637
|
|
|
@@ -22,7 +22,7 @@ export default function (opts) {
|
|
|
22
22
|
// All possible word characters (everything without punctuation, spaces & controls)
|
|
23
23
|
// Defined via punctuation & spaces to save space
|
|
24
24
|
// Should be something like \p{\L\N\S\M} (\w but without `_`)
|
|
25
|
-
re.src_pseudo_letter =
|
|
25
|
+
re.src_pseudo_letter = `(?:(?!${text_separators}|${re.src_ZPCc})${re.src_Any})`
|
|
26
26
|
// The same as abothe but without [0-9]
|
|
27
27
|
// var src_pseudo_letter_non_d = '(?:(?![0-9]|' + src_ZPCc + ')' + src_Any + ')';
|
|
28
28
|
|
|
@@ -31,7 +31,9 @@ export default function (opts) {
|
|
|
31
31
|
'(?:(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)'
|
|
32
32
|
|
|
33
33
|
// Prohibit any of "@/[]()" in user/pass to avoid wrong domain fetch.
|
|
34
|
-
|
|
34
|
+
// Length is capped to exclude possible rescans till the end and avoid O(n^2)
|
|
35
|
+
// DoS. No standard limit, just take something reasonable.
|
|
36
|
+
re.src_auth = `(?:(?:(?!${re.src_ZCc}|[@/\\[\\]()]).){1,50}@)?`
|
|
35
37
|
|
|
36
38
|
re.src_port =
|
|
37
39
|
|
|
@@ -39,23 +41,23 @@ export default function (opts) {
|
|
|
39
41
|
|
|
40
42
|
re.src_host_terminator =
|
|
41
43
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
+
`(?=$|${text_separators}|${re.src_ZPCc})` +
|
|
45
|
+
`(?!${opts['---'] ? '-(?!--)|' : '-|'}_|:\\d|\\.-|\\.(?!$|${re.src_ZPCc}))`
|
|
44
46
|
|
|
45
47
|
re.src_path =
|
|
46
48
|
|
|
47
49
|
'(?:' +
|
|
48
50
|
'[/?#]' +
|
|
49
51
|
'(?:' +
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
52
|
+
`(?!${re.src_ZCc}|${text_separators}|[()[\\]{}.,"'?!\\-;]).|` +
|
|
53
|
+
`\\[(?:(?!${re.src_ZCc}|\\]).)*\\]|` +
|
|
54
|
+
`\\((?:(?!${re.src_ZCc}|[)]).)*\\)|` +
|
|
55
|
+
`\\{(?:(?!${re.src_ZCc}|[}]).)*\\}|` +
|
|
56
|
+
`\\"(?:(?!${re.src_ZCc}|["]).)+\\"|` +
|
|
57
|
+
`\\'(?:(?!${re.src_ZCc}|[']).)+\\'|` +
|
|
56
58
|
|
|
57
59
|
// allow `I'm_king` if no pair found
|
|
58
|
-
|
|
60
|
+
`\\'(?=${re.src_pseudo_letter}|[-])|` +
|
|
59
61
|
|
|
60
62
|
// google has many dots in "google search" links (#66, #81).
|
|
61
63
|
// github has ... in commit range links,
|
|
@@ -67,30 +69,32 @@ export default function (opts) {
|
|
|
67
69
|
// until more examples found.
|
|
68
70
|
'\\.{2,}[a-zA-Z0-9%/&]|' +
|
|
69
71
|
|
|
70
|
-
|
|
72
|
+
`\\.(?!${re.src_ZCc}|[.]|$)|` +
|
|
71
73
|
(opts['---']
|
|
72
74
|
? '\\-(?!--(?:[^-]|$))(?:-*)|' // `---` => long dash, terminate
|
|
73
75
|
: '\\-+|'
|
|
74
76
|
) +
|
|
75
77
|
// allow `,,,` in paths
|
|
76
|
-
|
|
78
|
+
`,(?!${re.src_ZCc}|$)|` +
|
|
77
79
|
|
|
78
80
|
// allow `;` if not followed by space-like char
|
|
79
|
-
|
|
81
|
+
`;(?!${re.src_ZCc}|$)|` +
|
|
80
82
|
|
|
81
83
|
// allow `!!!` in paths, but not at the end
|
|
82
|
-
|
|
84
|
+
`\\!+(?!${re.src_ZCc}|[!]|$)|` +
|
|
83
85
|
|
|
84
|
-
|
|
86
|
+
`\\?(?!${re.src_ZCc}|[?]|$)` +
|
|
85
87
|
')+' +
|
|
86
88
|
'|\\/' +
|
|
87
89
|
')?'
|
|
88
90
|
|
|
89
91
|
// Allow anything in markdown spec, forbid quote (") at the first position
|
|
90
92
|
// because emails enclosed in quotes are far more common
|
|
93
|
+
// Max name length capped to 64 chars (RFC 5321). This also prevents O(n^2)
|
|
94
|
+
// rescans to the end on inputs like `mailto:mailto:...`
|
|
91
95
|
re.src_email_name =
|
|
92
96
|
|
|
93
|
-
'[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]
|
|
97
|
+
'[\\-;:&=\\+\\$,\\.a-zA-Z0-9_][\\-;:&=\\+\\$,\\"\\.a-zA-Z0-9_]{0,63}'
|
|
94
98
|
|
|
95
99
|
re.src_xn =
|
|
96
100
|
|
|
@@ -105,7 +109,7 @@ export default function (opts) {
|
|
|
105
109
|
'(?:' +
|
|
106
110
|
re.src_xn +
|
|
107
111
|
'|' +
|
|
108
|
-
re.src_pseudo_letter
|
|
112
|
+
`${re.src_pseudo_letter}{1,63}` +
|
|
109
113
|
')'
|
|
110
114
|
|
|
111
115
|
re.src_domain =
|
|
@@ -113,9 +117,9 @@ export default function (opts) {
|
|
|
113
117
|
'(?:' +
|
|
114
118
|
re.src_xn +
|
|
115
119
|
'|' +
|
|
116
|
-
|
|
120
|
+
`(?:${re.src_pseudo_letter})` +
|
|
117
121
|
'|' +
|
|
118
|
-
|
|
122
|
+
`(?:${re.src_pseudo_letter}(?:-|${re.src_pseudo_letter}){0,61}${re.src_pseudo_letter})` +
|
|
119
123
|
')'
|
|
120
124
|
|
|
121
125
|
re.src_host =
|
|
@@ -124,7 +128,7 @@ export default function (opts) {
|
|
|
124
128
|
// Don't need IP check, because digits are already allowed in normal domain names
|
|
125
129
|
// src_ip4 +
|
|
126
130
|
// '|' +
|
|
127
|
-
|
|
131
|
+
`(?:(?:(?:${re.src_domain})\\.)*${re.src_domain})`/* _root */ +
|
|
128
132
|
')'
|
|
129
133
|
|
|
130
134
|
re.tpl_host_fuzzy =
|
|
@@ -132,12 +136,12 @@ export default function (opts) {
|
|
|
132
136
|
'(?:' +
|
|
133
137
|
re.src_ip4 +
|
|
134
138
|
'|' +
|
|
135
|
-
|
|
139
|
+
`(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))` +
|
|
136
140
|
')'
|
|
137
141
|
|
|
138
142
|
re.tpl_host_no_ip_fuzzy =
|
|
139
143
|
|
|
140
|
-
|
|
144
|
+
`(?:(?:(?:${re.src_domain})\\.)+(?:%TLDS%))`
|
|
141
145
|
|
|
142
146
|
re.src_host_strict =
|
|
143
147
|
|
|
@@ -166,24 +170,24 @@ export default function (opts) {
|
|
|
166
170
|
// Rude test fuzzy links by host, for quick deny
|
|
167
171
|
re.tpl_host_fuzzy_test =
|
|
168
172
|
|
|
169
|
-
|
|
173
|
+
`localhost|www\\.|\\.\\d{1,3}\\.|(?:\\.(?:%TLDS%)(?:${re.src_ZPCc}|>|$))`
|
|
170
174
|
|
|
171
175
|
re.tpl_email_fuzzy =
|
|
172
176
|
|
|
173
|
-
|
|
174
|
-
|
|
177
|
+
`(^|${text_separators}|"|\\(|${re.src_ZCc})` +
|
|
178
|
+
`(${re.src_email_name}@${re.tpl_host_fuzzy_strict})`
|
|
175
179
|
|
|
176
180
|
re.tpl_link_fuzzy =
|
|
177
181
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
178
182
|
// but can start with > (markdown blockquote)
|
|
179
|
-
|
|
180
|
-
|
|
183
|
+
`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${re.src_ZPCc}))` +
|
|
184
|
+
`((?![$+<=>^\`|\uff5c])${re.tpl_host_port_fuzzy_strict}${re.src_path})`
|
|
181
185
|
|
|
182
186
|
re.tpl_link_no_ip_fuzzy =
|
|
183
187
|
// Fuzzy link can't be prepended with .:/\- and non punctuation.
|
|
184
188
|
// but can start with > (markdown blockquote)
|
|
185
|
-
|
|
186
|
-
|
|
189
|
+
`(^|(?![.:/\\-_@])(?:[$+<=>^\`|\uff5c]|${re.src_ZPCc}))` +
|
|
190
|
+
`((?![$+<=>^\`|\uff5c])${re.tpl_host_port_no_ip_fuzzy_strict}${re.src_path})`
|
|
187
191
|
|
|
188
192
|
return re
|
|
189
193
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "linkify-it",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"description": "Links recognition library with FULL unicode support",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"linkify",
|
|
@@ -39,30 +39,25 @@
|
|
|
39
39
|
],
|
|
40
40
|
"scripts": {
|
|
41
41
|
"lint": "eslint .",
|
|
42
|
-
"test": "npm run lint && npm run build && c8 --exclude build --exclude test -r text -r html -r lcov
|
|
42
|
+
"test": "npm run lint && npm run build && c8 --exclude build --exclude test -r text -r html -r lcov node --test",
|
|
43
43
|
"demo": "npm run lint && node support/build_demo.mjs",
|
|
44
44
|
"doc": "node support/build_doc.mjs",
|
|
45
45
|
"build": "rollup -c support/rollup.config.mjs",
|
|
46
|
-
"gh-pages": "npm run demo && npm run doc &&
|
|
47
|
-
"
|
|
46
|
+
"gh-pages": "npm run demo && npm run doc && gh-pages -d demo -f",
|
|
47
|
+
"prepack": "npm test && npm run build && npm run demo && npm run doc",
|
|
48
|
+
"postpublish": "npm run gh-pages"
|
|
48
49
|
},
|
|
49
50
|
"dependencies": {
|
|
50
51
|
"uc.micro": "^2.0.0"
|
|
51
52
|
},
|
|
52
53
|
"devDependencies": {
|
|
53
54
|
"@rollup/plugin-node-resolve": "^15.2.3",
|
|
54
|
-
"
|
|
55
|
-
"
|
|
56
|
-
"c8": "^8.0.1",
|
|
57
|
-
"eslint": "^8.54.0",
|
|
58
|
-
"eslint-config-standard": "^17.1.0",
|
|
55
|
+
"c8": "^11.0.0",
|
|
56
|
+
"eslint": "^9.39.3",
|
|
59
57
|
"gh-pages": "^6.1.0",
|
|
60
|
-
"
|
|
61
|
-
"
|
|
58
|
+
"mitata": "^1.0.34",
|
|
59
|
+
"neostandard": "^0.13.0",
|
|
62
60
|
"ndoc": "^6.0.0",
|
|
63
|
-
"rollup": "^4.6.1"
|
|
64
|
-
"shelljs": "^0.8.4",
|
|
65
|
-
"shx": "^0.3.2",
|
|
66
|
-
"tlds": "^1.166.0"
|
|
61
|
+
"rollup": "^4.6.1"
|
|
67
62
|
}
|
|
68
63
|
}
|