@openclaw/matrix 2026.9.1 → 2026.9.3
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/{account-selection-DA-jfx22.js → account-selection-Bbtc483D.js} +9 -1
- package/dist/{accounts-DR1c4xF_.js → accounts-GwSAk9vY.js} +2 -2
- package/dist/api.js +6 -6
- package/dist/{approval-handler.runtime-B_6ytY5I.js → approval-handler.runtime-tJLn5JFB.js} +6 -6
- package/dist/{approval-ids-CfHtZ9d1.js → approval-ids-DJZ9ZTuS.js} +1 -1
- package/dist/{approval-reaction-auth-BpDvJqfy.js → approval-reaction-auth-Cd0sKHFc.js} +2 -2
- package/dist/{channel-b-jES-oi.js → channel-BpYiqmx-.js} +10 -39
- package/dist/channel-plugin-api.js +1 -1
- package/dist/{channel.runtime-BkqjwEDU.js → channel.runtime-dfEvRdLQ.js} +6 -11
- package/dist/{channel.setup-BY42QaL7.js → channel.setup-oxd8RsIr.js} +7 -4
- package/dist/{cli-CtYeU7ol.js → cli-_49Vsqs4.js} +149 -115
- package/dist/{cli-metadata-B7MQjR5S.js → cli-metadata-D19lmKmz.js} +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/{client-D2utPQ1E.js → client-BXQCQDfY.js} +2 -2
- package/dist/{client-Dj4mcf-s.js → client-COLiUdWe.js} +6 -6
- package/dist/{client-bootstrap-n1Rqc8Go.js → client-bootstrap-CQwf9qrm.js} +1 -6
- package/dist/contract-api.js +2 -2
- package/dist/{credentials-DJj2xs3q.js → credentials-DysXbkv2.js} +2 -2
- package/dist/{credentials-read-mexhw-Ur.js → credentials-read-WWpqi88V.js} +1 -1
- package/dist/{credentials-write.runtime-DQt-kgJq.js → credentials-write.runtime-D22lPwRO.js} +1 -1
- package/dist/{crypto-runtime-m1eplj3b.js → crypto-runtime-BvunIYVn.js} +2 -2
- package/dist/{crypto-snapshot-doctor.runtime-D0v841D_.js → crypto-snapshot-doctor.runtime-DxgUMXUy.js} +2 -2
- package/dist/{directory-live-DLUgWBhA.js → directory-live-DABCxf8j.js} +2 -2
- package/dist/doctor-contract-api.js +43 -23
- package/dist/{draft-stream-DPYdv4fE.js → draft-stream-DSwgyyBi.js} +16 -5
- package/dist/{encryption-guidance-BNcZNQZI.js → encryption-guidance-mDyxJV9U.js} +1 -1
- package/dist/{event-helpers-XRfAbOIh.js → event-helpers-CspuhE9k.js} +9 -1
- package/dist/helper-api.js +3 -3
- package/dist/{http-client-DOmFvKvB.js → http-client-BfPeF4CE.js} +1 -1
- package/dist/{idb-persistence-CU7CNLlX.js → idb-persistence-DBdwHSWg.js} +1 -1
- package/dist/index.js +1 -1
- package/dist/{messages-C1U3b1oN.js → messages-H4mi9Cap.js} +6 -99
- package/dist/{monitor-SNnu-0bp.js → monitor-3Fw96uiE.js} +84 -118
- package/dist/{outbound-CeCEtF_q.js → outbound-UPI45TD_.js} +1 -1
- package/dist/plugin-entry.handlers.runtime.js +1 -1
- package/dist/probe.runtime-DdXTrrmo.js +2 -0
- package/dist/{profile-update-Cd1p8ABr.js → profile-update-DWEg8Ylt.js} +1 -1
- package/dist/{reaction-events-DveJRUaX.js → reaction-events-D-iSW0iM.js} +5 -7
- package/dist/{resolve-targets-B64O69Nd.js → resolve-targets-BpnALDzR.js} +1 -1
- package/dist/{resolver.runtime-TRmePJDV.js → resolver.runtime-B83WkznZ.js} +1 -1
- package/dist/{room-info-DVkKDscD.js → room-info-CjnbX52D.js} +7 -4
- package/dist/runtime-api.js +2 -2
- package/dist/{sdk-C1yfda1L.js → sdk-CX9b0N8Q.js} +13 -6
- package/dist/{send-DG7Bnj7_.js → send-B9l1lKau.js} +201 -97
- package/dist/session-binding-contract-api.js +1 -1
- package/dist/{setup-bootstrap-Co985F63.js → setup-bootstrap-CSI1L1lm.js} +2 -2
- package/dist/{setup-core-CEF6exLW.js → setup-core-DuTlyqRz.js} +3 -3
- package/dist/setup-plugin-api.js +1 -1
- package/dist/{setup-surface-BSlj1vnL.js → setup-surface-fZing1WZ.js} +6 -6
- package/dist/{startup-verification-1Ney1mmI.js → startup-verification-BTSf31hS.js} +2 -1
- package/dist/storage-CV-pfV_2.js +320 -0
- package/dist/{storage-BVf4uucD.js → storage-metadata-DYArLcq1.js} +14 -319
- package/dist/{storage-paths-gUmSydsW.js → storage-paths-DVCANXTc.js} +13 -1
- package/dist/{sync-cache-state-d-A_OhbU.js → sync-cache-state-C-mhj3xb.js} +9 -3
- package/dist/{thread-bindings-DgxQEB99.js → thread-bindings-CRyf5on_.js} +3 -2
- package/dist/{tool-actions.runtime-vbkQgU7D.js → tool-actions.runtime-D5-hTkDu.js} +10 -10
- package/dist/types-DzSc7Sqm.js +32 -0
- package/dist/{verification-D-iOebn4.js → verification-B_aqtbx-.js} +2 -2
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts +69 -4
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +526 -432
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +358 -265
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +8 -7
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +216 -183
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -1
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +7 -7
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -1
- package/node_modules/markdown-it/dist/markdown-it.cjs.js +98 -106
- package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -1
- package/node_modules/markdown-it/dist/markdown-it.d.mts +42 -71
- package/node_modules/markdown-it/dist/markdown-it.mjs +98 -106
- package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -1
- package/node_modules/markdown-it/package.json +1 -2
- package/node_modules/typebox/build/format/json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer.mjs +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.d.mts +2 -2
- package/node_modules/typebox/build/format/json_pointer_uri_fragment.mjs +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.d.mts +2 -2
- package/node_modules/typebox/build/format/relative_json_pointer.mjs +2 -2
- package/node_modules/typebox/build/system/memory/assign.mjs +2 -1
- package/node_modules/typebox/build/system/memory/create.mjs +3 -4
- package/node_modules/typebox/build/system/memory/discard.mjs +2 -2
- package/node_modules/typebox/build/system/memory/freeze.d.mts +4 -0
- package/node_modules/typebox/build/system/memory/freeze.mjs +6 -0
- package/node_modules/typebox/build/system/memory/update.mjs +3 -2
- package/node_modules/typebox/package.json +1 -1
- package/openclaw.plugin.json +24 -3
- package/package.json +7 -7
- package/dist/probe.runtime-B1YPxG9x.js +0 -2
- package/dist/runtime-BefyhPWv.js +0 -6
|
@@ -43,21 +43,43 @@ interface Delimiter {
|
|
|
43
43
|
* @category Main
|
|
44
44
|
*/
|
|
45
45
|
interface MarkdownItOptions {
|
|
46
|
-
/**
|
|
46
|
+
/**
|
|
47
|
+
* Enable HTML tags in source.
|
|
48
|
+
*
|
|
49
|
+
* @defaultValue `false` (`true` for `'commonmark'` preset only)
|
|
50
|
+
*/
|
|
47
51
|
html?: boolean;
|
|
48
|
-
/**
|
|
52
|
+
/**
|
|
53
|
+
* Use '/' to close single tags (`<br />`).
|
|
54
|
+
*
|
|
55
|
+
* @defaultValue `false` (`true` for `'commonmark'` preset only)
|
|
56
|
+
*/
|
|
49
57
|
xhtmlOut?: boolean;
|
|
50
|
-
/**
|
|
58
|
+
/**
|
|
59
|
+
* Convert '\n' in paragraphs into `<br>`.
|
|
60
|
+
*
|
|
61
|
+
* @defaultValue `false`
|
|
62
|
+
*/
|
|
51
63
|
breaks?: boolean;
|
|
52
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* CSS language prefix for fenced blocks, used by external syntax highlighters.
|
|
66
|
+
*
|
|
67
|
+
* @defaultValue `'language-'`
|
|
68
|
+
*/
|
|
53
69
|
langPrefix?: string;
|
|
54
|
-
/**
|
|
70
|
+
/**
|
|
71
|
+
* Autoconvert URL-like text to links.
|
|
72
|
+
*
|
|
73
|
+
* @defaultValue `false`
|
|
74
|
+
*/
|
|
55
75
|
linkify?: boolean;
|
|
56
76
|
/**
|
|
57
77
|
* Enable language-neutral replacements and quotes beautification.
|
|
58
78
|
*
|
|
59
79
|
* See the [replacement rules](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/replacements.ts)
|
|
60
80
|
* for the full list.
|
|
81
|
+
*
|
|
82
|
+
* @defaultValue `false`
|
|
61
83
|
*/
|
|
62
84
|
typographer?: boolean;
|
|
63
85
|
/**
|
|
@@ -66,6 +88,8 @@ interface MarkdownItOptions {
|
|
|
66
88
|
*
|
|
67
89
|
* For example, use `'«»„“'` for Russian, `'„“‚‘'` for German, and
|
|
68
90
|
* `['«\xA0', '\xA0»', '‹\xA0', '\xA0›']` for French (including nbsp).
|
|
91
|
+
*
|
|
92
|
+
* @defaultValue `'“”‘’'`
|
|
69
93
|
*/
|
|
70
94
|
quotes?: string | string[];
|
|
71
95
|
/**
|
|
@@ -114,9 +138,15 @@ interface MarkdownItOptions {
|
|
|
114
138
|
* }
|
|
115
139
|
* });
|
|
116
140
|
* ```
|
|
141
|
+
*
|
|
142
|
+
* @defaultValue `null`
|
|
117
143
|
*/
|
|
118
144
|
highlight?: ((str: string, lang: string, attrs: string) => string) | null;
|
|
119
|
-
/**
|
|
145
|
+
/**
|
|
146
|
+
* Internal protection against excessive recursion.
|
|
147
|
+
*
|
|
148
|
+
* @defaultValue `100`
|
|
149
|
+
*/
|
|
120
150
|
maxNesting?: number;
|
|
121
151
|
}
|
|
122
152
|
declare namespace utils_d_exports {
|
|
@@ -376,24 +406,23 @@ type RuleOptions = {
|
|
|
376
406
|
* {@link MarkdownIt.use}.
|
|
377
407
|
*/
|
|
378
408
|
declare class Ruler<Args extends unknown[], Result> {
|
|
409
|
+
/** @internal */
|
|
379
410
|
__rules__: Array<{
|
|
380
411
|
name: string;
|
|
381
412
|
enabled: boolean;
|
|
382
413
|
fn: (...args: Args) => Result;
|
|
383
414
|
alt: string[];
|
|
384
415
|
}>;
|
|
416
|
+
/** @internal */
|
|
385
417
|
__cache__: Record<string, Array<(...args: Args) => Result>> | null;
|
|
418
|
+
/** @internal */
|
|
386
419
|
__find__(name: string): number;
|
|
420
|
+
/** @internal */
|
|
387
421
|
__compile__(): void;
|
|
388
422
|
/**
|
|
389
423
|
* Replace rule by name with new function & options. Throws error if name not
|
|
390
424
|
* found.
|
|
391
425
|
*
|
|
392
|
-
* @param name Rule name to replace.
|
|
393
|
-
* @param fn New rule function.
|
|
394
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
395
|
-
* chains.
|
|
396
|
-
*
|
|
397
426
|
* @example Replace existing typographer replacement rule with new one
|
|
398
427
|
* ```javascript
|
|
399
428
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -409,12 +438,6 @@ declare class Ruler<Args extends unknown[], Result> {
|
|
|
409
438
|
* Add new rule to chain before one with given name. See also
|
|
410
439
|
* {@link Ruler.after}, {@link Ruler.push}.
|
|
411
440
|
*
|
|
412
|
-
* @param beforeName New rule will be added before this one.
|
|
413
|
-
* @param ruleName Name of added rule.
|
|
414
|
-
* @param fn Rule function.
|
|
415
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
416
|
-
* chains.
|
|
417
|
-
*
|
|
418
441
|
* @example
|
|
419
442
|
* ```javascript
|
|
420
443
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -430,12 +453,6 @@ declare class Ruler<Args extends unknown[], Result> {
|
|
|
430
453
|
* Add new rule to chain after one with given name. See also
|
|
431
454
|
* {@link Ruler.before}, {@link Ruler.push}.
|
|
432
455
|
*
|
|
433
|
-
* @param afterName New rule will be added after this one.
|
|
434
|
-
* @param ruleName Name of added rule.
|
|
435
|
-
* @param fn Rule function.
|
|
436
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
437
|
-
* chains.
|
|
438
|
-
*
|
|
439
456
|
* @example
|
|
440
457
|
* ```javascript
|
|
441
458
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -451,11 +468,6 @@ declare class Ruler<Args extends unknown[], Result> {
|
|
|
451
468
|
* Push new rule to the end of chain. See also
|
|
452
469
|
* {@link Ruler.before}, {@link Ruler.after}.
|
|
453
470
|
*
|
|
454
|
-
* @param ruleName Name of added rule.
|
|
455
|
-
* @param fn Rule function.
|
|
456
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
457
|
-
* chains.
|
|
458
|
-
*
|
|
459
471
|
* @example
|
|
460
472
|
* ```javascript
|
|
461
473
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -473,9 +485,7 @@ declare class Ruler<Args extends unknown[], Result> {
|
|
|
473
485
|
*
|
|
474
486
|
* See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
|
|
475
487
|
*
|
|
476
|
-
*
|
|
477
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
478
|
-
* @returns List of found rule names (if no exception happened).
|
|
488
|
+
* Returns list of found rule names (if no exception happened).
|
|
479
489
|
*/
|
|
480
490
|
enable(list: string | string[], ignoreInvalid?: boolean): string[];
|
|
481
491
|
/**
|
|
@@ -483,9 +493,6 @@ declare class Ruler<Args extends unknown[], Result> {
|
|
|
483
493
|
* not found - throw Error. Errors can be disabled by second param.
|
|
484
494
|
*
|
|
485
495
|
* See also {@link Ruler.disable}, {@link Ruler.enable}.
|
|
486
|
-
*
|
|
487
|
-
* @param list List of rule names to enable (whitelist).
|
|
488
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
489
496
|
*/
|
|
490
497
|
enableOnly(list: string | string[], ignoreInvalid?: boolean): void;
|
|
491
498
|
/**
|
|
@@ -494,9 +501,7 @@ declare class Ruler<Args extends unknown[], Result> {
|
|
|
494
501
|
*
|
|
495
502
|
* See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
|
|
496
503
|
*
|
|
497
|
-
*
|
|
498
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
499
|
-
* @returns List of found rule names (if no exception happened).
|
|
504
|
+
* Returns list of found rule names (if no exception happened).
|
|
500
505
|
*/
|
|
501
506
|
disable(list: string | string[], ignoreInvalid?: boolean): string[];
|
|
502
507
|
/**
|
|
@@ -553,37 +558,21 @@ declare class Renderer {
|
|
|
553
558
|
/**
|
|
554
559
|
* Default token renderer. Can be overriden by custom function
|
|
555
560
|
* in {@link Renderer.rules}.
|
|
556
|
-
*
|
|
557
|
-
* @param tokens List of tokens.
|
|
558
|
-
* @param idx Token index to render.
|
|
559
|
-
* @param options Params of parser instance.
|
|
560
561
|
*/
|
|
561
562
|
renderToken(tokens: Token[], idx: number, options: Required<MarkdownItOptions>): string;
|
|
562
563
|
/**
|
|
563
564
|
* The same as {@link Renderer.render}, but for single token of `inline` type.
|
|
564
|
-
*
|
|
565
|
-
* @param tokens List on block tokens to render.
|
|
566
|
-
* @param options Params of parser instance.
|
|
567
|
-
* @param env Additional data from parsed input (references, for example).
|
|
568
565
|
*/
|
|
569
566
|
renderInline(tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string;
|
|
570
567
|
/**
|
|
571
568
|
* Special kludge for image `alt` attributes to conform CommonMark spec.
|
|
572
569
|
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
|
573
570
|
* instead of simple escaping.
|
|
574
|
-
*
|
|
575
|
-
* @param tokens List on block tokens to render.
|
|
576
|
-
* @param options Params of parser instance.
|
|
577
|
-
* @param env Additional data from parsed input (references, for example).
|
|
578
571
|
*/
|
|
579
572
|
renderInlineAsText(tokens: Token[], options: Required<MarkdownItOptions>, env: Env | undefined): string;
|
|
580
573
|
/**
|
|
581
574
|
* Takes token stream and generates HTML. Probably, you will never need to call
|
|
582
575
|
* this method directly.
|
|
583
|
-
*
|
|
584
|
-
* @param tokens List on block tokens to render.
|
|
585
|
-
* @param options Params of parser instance.
|
|
586
|
-
* @param env Additional data from parsed input (references, for example).
|
|
587
576
|
*/
|
|
588
577
|
render(tokens: Token[], options: Required<MarkdownItOptions>, env?: Env): string;
|
|
589
578
|
}
|
|
@@ -873,9 +862,6 @@ declare class MarkdownIt {
|
|
|
873
862
|
* containing rules with given names. If rule not found, and `ignoreInvalid`
|
|
874
863
|
* not set - throws exception.
|
|
875
864
|
*
|
|
876
|
-
* @param list Rule name or list of rule names to enable.
|
|
877
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
878
|
-
*
|
|
879
865
|
* @example
|
|
880
866
|
* ```javascript
|
|
881
867
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -888,9 +874,6 @@ declare class MarkdownIt {
|
|
|
888
874
|
enable(list: string | string[], ignoreInvalid?: boolean): this;
|
|
889
875
|
/**
|
|
890
876
|
* The same as {@link MarkdownIt.enable}, but turn specified rules off.
|
|
891
|
-
*
|
|
892
|
-
* @param list Rule name or list of rule names to disable.
|
|
893
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
894
877
|
*/
|
|
895
878
|
disable(list: string | string[], ignoreInvalid?: boolean): this;
|
|
896
879
|
/**
|
|
@@ -919,9 +902,6 @@ declare class MarkdownIt {
|
|
|
919
902
|
* metadata like reference info, needed for the renderer. It also can be used to
|
|
920
903
|
* inject data in specific cases. Usually, you will be ok to pass `{}`,
|
|
921
904
|
* and then pass updated object to renderer.
|
|
922
|
-
*
|
|
923
|
-
* @param src Source string.
|
|
924
|
-
* @param env Environment sandbox.
|
|
925
905
|
*/
|
|
926
906
|
parse(src: string, env: Env): Token[];
|
|
927
907
|
/**
|
|
@@ -930,26 +910,17 @@ declare class MarkdownIt {
|
|
|
930
910
|
* `env` can be used to inject additional metadata (`{}` by default).
|
|
931
911
|
* But you will not need it with high probability. See also comment
|
|
932
912
|
* in {@link MarkdownIt.parse}.
|
|
933
|
-
*
|
|
934
|
-
* @param src Source string.
|
|
935
|
-
* @param env Environment sandbox.
|
|
936
913
|
*/
|
|
937
914
|
render(src: string, env?: Env): string;
|
|
938
915
|
/**
|
|
939
916
|
* The same as {@link MarkdownIt.parse} but skip all block rules. It returns
|
|
940
917
|
* the block tokens list with the single `inline` element, containing parsed
|
|
941
918
|
* inline tokens in `children` property. Also updates `env` object.
|
|
942
|
-
*
|
|
943
|
-
* @param src Source string.
|
|
944
|
-
* @param env Environment sandbox.
|
|
945
919
|
*/
|
|
946
920
|
parseInline(src: string, env: Env): Token[];
|
|
947
921
|
/**
|
|
948
922
|
* Similar to {@link MarkdownIt.render} but for single paragraph content.
|
|
949
923
|
* Result will NOT be wrapped into `<p>` tags.
|
|
950
|
-
*
|
|
951
|
-
* @param src Source string.
|
|
952
|
-
* @param env Environment sandbox.
|
|
953
924
|
*/
|
|
954
925
|
renderInline(src: string, env?: Env): string;
|
|
955
926
|
static Token: typeof Token;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! markdown-it 15.0.
|
|
1
|
+
/*! markdown-it 15.0.1 https://github.com/markdown-it/markdown-it @license MIT */
|
|
2
2
|
import * as mdurl from "mdurl";
|
|
3
3
|
import * as ucmicro from "uc.micro";
|
|
4
4
|
import { decodeHTMLStrict } from "entities";
|
|
@@ -587,13 +587,25 @@ var Token = class {
|
|
|
587
587
|
*/
|
|
588
588
|
var Ruler = class {
|
|
589
589
|
constructor() {
|
|
590
|
-
_defineProperty(
|
|
591
|
-
|
|
590
|
+
_defineProperty(
|
|
591
|
+
this,
|
|
592
|
+
/** @internal */
|
|
593
|
+
"__rules__",
|
|
594
|
+
[]
|
|
595
|
+
);
|
|
596
|
+
_defineProperty(
|
|
597
|
+
this,
|
|
598
|
+
/** @internal */
|
|
599
|
+
"__cache__",
|
|
600
|
+
null
|
|
601
|
+
);
|
|
592
602
|
}
|
|
603
|
+
/** @internal */
|
|
593
604
|
__find__(name) {
|
|
594
605
|
for (let i = 0; i < this.__rules__.length; i++) if (this.__rules__[i].name === name) return i;
|
|
595
606
|
return -1;
|
|
596
607
|
}
|
|
608
|
+
/** @internal */
|
|
597
609
|
__compile__() {
|
|
598
610
|
const chains = /* @__PURE__ */ new Set();
|
|
599
611
|
this.__rules__.forEach((rule) => {
|
|
@@ -618,11 +630,6 @@ var Ruler = class {
|
|
|
618
630
|
* Replace rule by name with new function & options. Throws error if name not
|
|
619
631
|
* found.
|
|
620
632
|
*
|
|
621
|
-
* @param name Rule name to replace.
|
|
622
|
-
* @param fn New rule function.
|
|
623
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
624
|
-
* chains.
|
|
625
|
-
*
|
|
626
633
|
* @example Replace existing typographer replacement rule with new one
|
|
627
634
|
* ```javascript
|
|
628
635
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -644,12 +651,6 @@ var Ruler = class {
|
|
|
644
651
|
* Add new rule to chain before one with given name. See also
|
|
645
652
|
* {@link Ruler.after}, {@link Ruler.push}.
|
|
646
653
|
*
|
|
647
|
-
* @param beforeName New rule will be added before this one.
|
|
648
|
-
* @param ruleName Name of added rule.
|
|
649
|
-
* @param fn Rule function.
|
|
650
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
651
|
-
* chains.
|
|
652
|
-
*
|
|
653
654
|
* @example
|
|
654
655
|
* ```javascript
|
|
655
656
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -675,12 +676,6 @@ var Ruler = class {
|
|
|
675
676
|
* Add new rule to chain after one with given name. See also
|
|
676
677
|
* {@link Ruler.before}, {@link Ruler.push}.
|
|
677
678
|
*
|
|
678
|
-
* @param afterName New rule will be added after this one.
|
|
679
|
-
* @param ruleName Name of added rule.
|
|
680
|
-
* @param fn Rule function.
|
|
681
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
682
|
-
* chains.
|
|
683
|
-
*
|
|
684
679
|
* @example
|
|
685
680
|
* ```javascript
|
|
686
681
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -706,11 +701,6 @@ var Ruler = class {
|
|
|
706
701
|
* Push new rule to the end of chain. See also
|
|
707
702
|
* {@link Ruler.before}, {@link Ruler.after}.
|
|
708
703
|
*
|
|
709
|
-
* @param ruleName Name of added rule.
|
|
710
|
-
* @param fn Rule function.
|
|
711
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
712
|
-
* chains.
|
|
713
|
-
*
|
|
714
704
|
* @example
|
|
715
705
|
* ```javascript
|
|
716
706
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -736,9 +726,7 @@ var Ruler = class {
|
|
|
736
726
|
*
|
|
737
727
|
* See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
|
|
738
728
|
*
|
|
739
|
-
*
|
|
740
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
741
|
-
* @returns List of found rule names (if no exception happened).
|
|
729
|
+
* Returns list of found rule names (if no exception happened).
|
|
742
730
|
*/
|
|
743
731
|
enable(list, ignoreInvalid = false) {
|
|
744
732
|
if (!Array.isArray(list)) list = [list];
|
|
@@ -760,9 +748,6 @@ var Ruler = class {
|
|
|
760
748
|
* not found - throw Error. Errors can be disabled by second param.
|
|
761
749
|
*
|
|
762
750
|
* See also {@link Ruler.disable}, {@link Ruler.enable}.
|
|
763
|
-
*
|
|
764
|
-
* @param list List of rule names to enable (whitelist).
|
|
765
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
766
751
|
*/
|
|
767
752
|
enableOnly(list, ignoreInvalid = false) {
|
|
768
753
|
if (!Array.isArray(list)) list = [list];
|
|
@@ -777,9 +762,7 @@ var Ruler = class {
|
|
|
777
762
|
*
|
|
778
763
|
* See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
|
|
779
764
|
*
|
|
780
|
-
*
|
|
781
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
782
|
-
* @returns List of found rule names (if no exception happened).
|
|
765
|
+
* Returns list of found rule names (if no exception happened).
|
|
783
766
|
*/
|
|
784
767
|
disable(list, ignoreInvalid = false) {
|
|
785
768
|
if (!Array.isArray(list)) list = [list];
|
|
@@ -919,10 +902,6 @@ var Renderer = class {
|
|
|
919
902
|
/**
|
|
920
903
|
* Default token renderer. Can be overriden by custom function
|
|
921
904
|
* in {@link Renderer.rules}.
|
|
922
|
-
*
|
|
923
|
-
* @param tokens List of tokens.
|
|
924
|
-
* @param idx Token index to render.
|
|
925
|
-
* @param options Params of parser instance.
|
|
926
905
|
*/
|
|
927
906
|
renderToken(tokens, idx, options) {
|
|
928
907
|
const token = tokens[idx];
|
|
@@ -952,10 +931,6 @@ var Renderer = class {
|
|
|
952
931
|
}
|
|
953
932
|
/**
|
|
954
933
|
* The same as {@link Renderer.render}, but for single token of `inline` type.
|
|
955
|
-
*
|
|
956
|
-
* @param tokens List on block tokens to render.
|
|
957
|
-
* @param options Params of parser instance.
|
|
958
|
-
* @param env Additional data from parsed input (references, for example).
|
|
959
934
|
*/
|
|
960
935
|
renderInline(tokens, options, env) {
|
|
961
936
|
let result = "";
|
|
@@ -971,10 +946,6 @@ var Renderer = class {
|
|
|
971
946
|
* Special kludge for image `alt` attributes to conform CommonMark spec.
|
|
972
947
|
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
|
973
948
|
* instead of simple escaping.
|
|
974
|
-
*
|
|
975
|
-
* @param tokens List on block tokens to render.
|
|
976
|
-
* @param options Params of parser instance.
|
|
977
|
-
* @param env Additional data from parsed input (references, for example).
|
|
978
949
|
*/
|
|
979
950
|
renderInlineAsText(tokens, options, env) {
|
|
980
951
|
let result = "";
|
|
@@ -998,10 +969,6 @@ var Renderer = class {
|
|
|
998
969
|
/**
|
|
999
970
|
* Takes token stream and generates HTML. Probably, you will never need to call
|
|
1000
971
|
* this method directly.
|
|
1001
|
-
*
|
|
1002
|
-
* @param tokens List on block tokens to render.
|
|
1003
|
-
* @param options Params of parser instance.
|
|
1004
|
-
* @param env Additional data from parsed input (references, for example).
|
|
1005
972
|
*/
|
|
1006
973
|
render(tokens, options, env) {
|
|
1007
974
|
let result = "";
|
|
@@ -1030,11 +997,11 @@ var StateCore = class {
|
|
|
1030
997
|
};
|
|
1031
998
|
//#endregion
|
|
1032
999
|
//#region src/rules_core/normalize.ts
|
|
1033
|
-
var
|
|
1000
|
+
var UNNORMALIZED_NEWLINE_RE = /\r\n?/g;
|
|
1034
1001
|
var NULL_RE = /\0/g;
|
|
1035
1002
|
function normalize(state) {
|
|
1036
1003
|
let str;
|
|
1037
|
-
str = state.src.replace(
|
|
1004
|
+
str = state.src.replace(UNNORMALIZED_NEWLINE_RE, "\n");
|
|
1038
1005
|
str = str.replace(NULL_RE, "�");
|
|
1039
1006
|
state.src = str;
|
|
1040
1007
|
}
|
|
@@ -1084,7 +1051,8 @@ function linkify$1(state) {
|
|
|
1084
1051
|
if (!state.md.options.linkify) return;
|
|
1085
1052
|
for (let j = 0, l = blockTokens.length; j < l; j++) {
|
|
1086
1053
|
if (blockTokens[j].type !== "inline" || !state.md.linkify.test(blockTokens[j].content)) continue;
|
|
1087
|
-
|
|
1054
|
+
const tokens = blockTokens[j].children;
|
|
1055
|
+
const replacements = [];
|
|
1088
1056
|
let htmlLinkLevel = 0;
|
|
1089
1057
|
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
1090
1058
|
const currentToken = tokens[i];
|
|
@@ -1143,9 +1111,28 @@ function linkify$1(state) {
|
|
|
1143
1111
|
token.level = level;
|
|
1144
1112
|
nodes.push(token);
|
|
1145
1113
|
}
|
|
1146
|
-
|
|
1114
|
+
replacements.push({
|
|
1115
|
+
index: i,
|
|
1116
|
+
nodes
|
|
1117
|
+
});
|
|
1147
1118
|
}
|
|
1148
1119
|
}
|
|
1120
|
+
if (replacements.length > 0) {
|
|
1121
|
+
let newTokensLength = tokens.length;
|
|
1122
|
+
for (const replacement of replacements) newTokensLength += replacement.nodes.length - 1;
|
|
1123
|
+
const newTokens = new Array(newTokensLength);
|
|
1124
|
+
let replacementIndex = 0;
|
|
1125
|
+
let newTokenIndex = 0;
|
|
1126
|
+
replacements.reverse();
|
|
1127
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
1128
|
+
const replacement = replacements[replacementIndex];
|
|
1129
|
+
if ((replacement === null || replacement === void 0 ? void 0 : replacement.index) === i) {
|
|
1130
|
+
for (const node of replacement.nodes) newTokens[newTokenIndex++] = node;
|
|
1131
|
+
replacementIndex++;
|
|
1132
|
+
} else newTokens[newTokenIndex++] = tokens[i];
|
|
1133
|
+
}
|
|
1134
|
+
blockTokens[j].children = newTokens;
|
|
1135
|
+
}
|
|
1149
1136
|
}
|
|
1150
1137
|
}
|
|
1151
1138
|
//#endregion
|
|
@@ -2628,7 +2615,12 @@ function text(state, silent) {
|
|
|
2628
2615
|
}
|
|
2629
2616
|
//#endregion
|
|
2630
2617
|
//#region src/rules_inline/linkify.ts
|
|
2631
|
-
|
|
2618
|
+
function isAsciiAlpha(code) {
|
|
2619
|
+
return code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
2620
|
+
}
|
|
2621
|
+
function isSchemeChar(code) {
|
|
2622
|
+
return code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 45 || code === 46;
|
|
2623
|
+
}
|
|
2632
2624
|
function linkify(state, silent) {
|
|
2633
2625
|
if (!state.md.options.linkify) return false;
|
|
2634
2626
|
if (state.linkLevel > 0) return false;
|
|
@@ -2638,20 +2630,22 @@ function linkify(state, silent) {
|
|
|
2638
2630
|
if (state.src.charCodeAt(pos) !== 58) return false;
|
|
2639
2631
|
if (state.src.charCodeAt(pos + 1) !== 47) return false;
|
|
2640
2632
|
if (state.src.charCodeAt(pos + 2) !== 47) return false;
|
|
2641
|
-
const
|
|
2642
|
-
|
|
2643
|
-
|
|
2644
|
-
|
|
2633
|
+
const protoMin = pos - Math.min(10, state.pending.length, pos);
|
|
2634
|
+
let protoStart = pos;
|
|
2635
|
+
while (protoStart > protoMin && isSchemeChar(state.src.charCodeAt(protoStart - 1))) protoStart--;
|
|
2636
|
+
if (protoStart === pos || !isAsciiAlpha(state.src.charCodeAt(protoStart))) return false;
|
|
2637
|
+
const protoLength = pos - protoStart;
|
|
2638
|
+
const link = state.md.linkify.matchAtStart(state.src.slice(protoStart));
|
|
2645
2639
|
if (!link) return false;
|
|
2646
2640
|
let url = link.url;
|
|
2647
|
-
if (url.length <=
|
|
2641
|
+
if (url.length <= protoLength) return false;
|
|
2648
2642
|
let urlEnd = url.length;
|
|
2649
2643
|
while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) urlEnd--;
|
|
2650
2644
|
if (urlEnd !== url.length) url = url.slice(0, urlEnd);
|
|
2651
2645
|
const fullUrl = state.md.normalizeLink(url);
|
|
2652
2646
|
if (!state.md.validateLink(fullUrl)) return false;
|
|
2653
2647
|
if (!silent) {
|
|
2654
|
-
state.pending = state.pending.slice(0, -
|
|
2648
|
+
state.pending = state.pending.slice(0, -protoLength);
|
|
2655
2649
|
const token_o = state.push("link_open", "a", 1);
|
|
2656
2650
|
token_o.attrs = [["href", fullUrl]];
|
|
2657
2651
|
token_o.markup = "linkify";
|
|
@@ -2662,7 +2656,7 @@ function linkify(state, silent) {
|
|
|
2662
2656
|
token_c.markup = "linkify";
|
|
2663
2657
|
token_c.info = "auto";
|
|
2664
2658
|
}
|
|
2665
|
-
state.pos += url.length -
|
|
2659
|
+
state.pos += url.length - protoLength;
|
|
2666
2660
|
return true;
|
|
2667
2661
|
}
|
|
2668
2662
|
//#endregion
|
|
@@ -2743,40 +2737,51 @@ function escape(state, silent) {
|
|
|
2743
2737
|
}
|
|
2744
2738
|
//#endregion
|
|
2745
2739
|
//#region src/rules_inline/backticks.ts
|
|
2740
|
+
function buildLastRuns(src) {
|
|
2741
|
+
const lastRuns = {};
|
|
2742
|
+
let pos = 0;
|
|
2743
|
+
while ((pos = src.indexOf("`", pos)) !== -1) {
|
|
2744
|
+
const start = pos;
|
|
2745
|
+
while (src.charCodeAt(++pos) === 96);
|
|
2746
|
+
lastRuns[pos - start] = start;
|
|
2747
|
+
}
|
|
2748
|
+
return lastRuns;
|
|
2749
|
+
}
|
|
2746
2750
|
function backtick(state, silent) {
|
|
2747
|
-
|
|
2748
|
-
|
|
2749
|
-
|
|
2750
|
-
pos++;
|
|
2751
|
+
var _state$backticks$open;
|
|
2752
|
+
const start = state.pos;
|
|
2753
|
+
if (state.src.charCodeAt(start) !== 96) return false;
|
|
2751
2754
|
const max = state.posMax;
|
|
2755
|
+
let pos = start + 1;
|
|
2752
2756
|
while (pos < max && state.src.charCodeAt(pos) === 96) pos++;
|
|
2753
2757
|
const marker = state.src.slice(start, pos);
|
|
2754
2758
|
const openerLength = marker.length;
|
|
2755
|
-
if (state.backticksScanned
|
|
2756
|
-
|
|
2757
|
-
state.
|
|
2758
|
-
|
|
2759
|
-
|
|
2760
|
-
|
|
2761
|
-
|
|
2762
|
-
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2770
|
-
|
|
2759
|
+
if (!state.backticksScanned) {
|
|
2760
|
+
state.backticks = buildLastRuns(state.src);
|
|
2761
|
+
state.backticksScanned = true;
|
|
2762
|
+
}
|
|
2763
|
+
if (((_state$backticks$open = state.backticks[openerLength]) !== null && _state$backticks$open !== void 0 ? _state$backticks$open : -1) >= pos) {
|
|
2764
|
+
let matchEnd = pos;
|
|
2765
|
+
let matchStart;
|
|
2766
|
+
while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1 && matchStart < max) {
|
|
2767
|
+
matchEnd = matchStart + 1;
|
|
2768
|
+
while (state.src.charCodeAt(matchEnd) === 96) matchEnd++;
|
|
2769
|
+
if (matchEnd > max) break;
|
|
2770
|
+
if (matchEnd - matchStart === openerLength) {
|
|
2771
|
+
if (!silent) {
|
|
2772
|
+
const token = state.push("code_inline", "code", 0);
|
|
2773
|
+
token.markup = marker;
|
|
2774
|
+
let content = state.src.slice(pos, matchStart).replace(/\n/g, " ");
|
|
2775
|
+
if (content.startsWith(" ") && content.endsWith(" ") && /[^ ]/.test(content)) content = content.slice(1, -1);
|
|
2776
|
+
token.content = content;
|
|
2777
|
+
}
|
|
2778
|
+
state.pos = matchEnd;
|
|
2779
|
+
return true;
|
|
2771
2780
|
}
|
|
2772
|
-
state.pos = matchEnd;
|
|
2773
|
-
return true;
|
|
2774
2781
|
}
|
|
2775
|
-
state.backticks[closerLength] = matchStart;
|
|
2776
2782
|
}
|
|
2777
|
-
state.backticksScanned = true;
|
|
2778
2783
|
if (!silent) state.pending += marker;
|
|
2779
|
-
state.pos
|
|
2784
|
+
state.pos = pos;
|
|
2780
2785
|
return true;
|
|
2781
2786
|
}
|
|
2782
2787
|
//#endregion
|
|
@@ -3551,7 +3556,12 @@ var MarkdownIt = class {
|
|
|
3551
3556
|
parsed.hostname = punycode.toASCII(parsed.hostname);
|
|
3552
3557
|
} catch (er) {}
|
|
3553
3558
|
}
|
|
3554
|
-
|
|
3559
|
+
if (parsed.auth) parsed.auth = mdurl.encode(parsed.auth);
|
|
3560
|
+
if (parsed.hostname) parsed.hostname = mdurl.encode(parsed.hostname);
|
|
3561
|
+
if (parsed.pathname) parsed.pathname = mdurl.encode(parsed.pathname);
|
|
3562
|
+
if (parsed.search) parsed.search = mdurl.encode(parsed.search);
|
|
3563
|
+
if (parsed.hash) parsed.hash = mdurl.encode(parsed.hash);
|
|
3564
|
+
return mdurl.format(parsed);
|
|
3555
3565
|
}
|
|
3556
3566
|
/**
|
|
3557
3567
|
* Function used to decode link url to a human-readable format`
|
|
@@ -3719,9 +3729,6 @@ var MarkdownIt = class {
|
|
|
3719
3729
|
* containing rules with given names. If rule not found, and `ignoreInvalid`
|
|
3720
3730
|
* not set - throws exception.
|
|
3721
3731
|
*
|
|
3722
|
-
* @param list Rule name or list of rule names to enable.
|
|
3723
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
3724
|
-
*
|
|
3725
3732
|
* @example
|
|
3726
3733
|
* ```javascript
|
|
3727
3734
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -3748,9 +3755,6 @@ var MarkdownIt = class {
|
|
|
3748
3755
|
}
|
|
3749
3756
|
/**
|
|
3750
3757
|
* The same as {@link MarkdownIt.enable}, but turn specified rules off.
|
|
3751
|
-
*
|
|
3752
|
-
* @param list Rule name or list of rule names to disable.
|
|
3753
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
3754
3758
|
*/
|
|
3755
3759
|
disable(list, ignoreInvalid = false) {
|
|
3756
3760
|
let result = [];
|
|
@@ -3796,9 +3800,6 @@ var MarkdownIt = class {
|
|
|
3796
3800
|
* metadata like reference info, needed for the renderer. It also can be used to
|
|
3797
3801
|
* inject data in specific cases. Usually, you will be ok to pass `{}`,
|
|
3798
3802
|
* and then pass updated object to renderer.
|
|
3799
|
-
*
|
|
3800
|
-
* @param src Source string.
|
|
3801
|
-
* @param env Environment sandbox.
|
|
3802
3803
|
*/
|
|
3803
3804
|
parse(src, env) {
|
|
3804
3805
|
if (typeof src !== "string") throw new Error("Input data should be a String");
|
|
@@ -3812,9 +3813,6 @@ var MarkdownIt = class {
|
|
|
3812
3813
|
* `env` can be used to inject additional metadata (`{}` by default).
|
|
3813
3814
|
* But you will not need it with high probability. See also comment
|
|
3814
3815
|
* in {@link MarkdownIt.parse}.
|
|
3815
|
-
*
|
|
3816
|
-
* @param src Source string.
|
|
3817
|
-
* @param env Environment sandbox.
|
|
3818
3816
|
*/
|
|
3819
3817
|
render(src, env = {}) {
|
|
3820
3818
|
return this.renderer.render(this.parse(src, env), this.options, env);
|
|
@@ -3823,9 +3821,6 @@ var MarkdownIt = class {
|
|
|
3823
3821
|
* The same as {@link MarkdownIt.parse} but skip all block rules. It returns
|
|
3824
3822
|
* the block tokens list with the single `inline` element, containing parsed
|
|
3825
3823
|
* inline tokens in `children` property. Also updates `env` object.
|
|
3826
|
-
*
|
|
3827
|
-
* @param src Source string.
|
|
3828
|
-
* @param env Environment sandbox.
|
|
3829
3824
|
*/
|
|
3830
3825
|
parseInline(src, env) {
|
|
3831
3826
|
const state = new this.core.State(src, this, env);
|
|
@@ -3836,9 +3831,6 @@ var MarkdownIt = class {
|
|
|
3836
3831
|
/**
|
|
3837
3832
|
* Similar to {@link MarkdownIt.render} but for single paragraph content.
|
|
3838
3833
|
* Result will NOT be wrapped into `<p>` tags.
|
|
3839
|
-
*
|
|
3840
|
-
* @param src Source string.
|
|
3841
|
-
* @param env Environment sandbox.
|
|
3842
3834
|
*/
|
|
3843
3835
|
renderInline(src, env = {}) {
|
|
3844
3836
|
return this.renderer.render(this.parseInline(src, env), this.options, env);
|