@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
|
@@ -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
|
//#region \0rolldown/runtime.js
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
@@ -1101,13 +1101,25 @@ var Token = class {
|
|
|
1101
1101
|
*/
|
|
1102
1102
|
var Ruler = class {
|
|
1103
1103
|
constructor() {
|
|
1104
|
-
_defineProperty(
|
|
1105
|
-
|
|
1104
|
+
_defineProperty(
|
|
1105
|
+
this,
|
|
1106
|
+
/** @internal */
|
|
1107
|
+
"__rules__",
|
|
1108
|
+
[]
|
|
1109
|
+
);
|
|
1110
|
+
_defineProperty(
|
|
1111
|
+
this,
|
|
1112
|
+
/** @internal */
|
|
1113
|
+
"__cache__",
|
|
1114
|
+
null
|
|
1115
|
+
);
|
|
1106
1116
|
}
|
|
1117
|
+
/** @internal */
|
|
1107
1118
|
__find__(name) {
|
|
1108
1119
|
for (let i = 0; i < this.__rules__.length; i++) if (this.__rules__[i].name === name) return i;
|
|
1109
1120
|
return -1;
|
|
1110
1121
|
}
|
|
1122
|
+
/** @internal */
|
|
1111
1123
|
__compile__() {
|
|
1112
1124
|
const chains = /* @__PURE__ */ new Set();
|
|
1113
1125
|
this.__rules__.forEach((rule) => {
|
|
@@ -1132,11 +1144,6 @@ var Ruler = class {
|
|
|
1132
1144
|
* Replace rule by name with new function & options. Throws error if name not
|
|
1133
1145
|
* found.
|
|
1134
1146
|
*
|
|
1135
|
-
* @param name Rule name to replace.
|
|
1136
|
-
* @param fn New rule function.
|
|
1137
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1138
|
-
* chains.
|
|
1139
|
-
*
|
|
1140
1147
|
* @example Replace existing typographer replacement rule with new one
|
|
1141
1148
|
* ```javascript
|
|
1142
1149
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -1158,12 +1165,6 @@ var Ruler = class {
|
|
|
1158
1165
|
* Add new rule to chain before one with given name. See also
|
|
1159
1166
|
* {@link Ruler.after}, {@link Ruler.push}.
|
|
1160
1167
|
*
|
|
1161
|
-
* @param beforeName New rule will be added before this one.
|
|
1162
|
-
* @param ruleName Name of added rule.
|
|
1163
|
-
* @param fn Rule function.
|
|
1164
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1165
|
-
* chains.
|
|
1166
|
-
*
|
|
1167
1168
|
* @example
|
|
1168
1169
|
* ```javascript
|
|
1169
1170
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -1189,12 +1190,6 @@ var Ruler = class {
|
|
|
1189
1190
|
* Add new rule to chain after one with given name. See also
|
|
1190
1191
|
* {@link Ruler.before}, {@link Ruler.push}.
|
|
1191
1192
|
*
|
|
1192
|
-
* @param afterName New rule will be added after this one.
|
|
1193
|
-
* @param ruleName Name of added rule.
|
|
1194
|
-
* @param fn Rule function.
|
|
1195
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1196
|
-
* chains.
|
|
1197
|
-
*
|
|
1198
1193
|
* @example
|
|
1199
1194
|
* ```javascript
|
|
1200
1195
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -1220,11 +1215,6 @@ var Ruler = class {
|
|
|
1220
1215
|
* Push new rule to the end of chain. See also
|
|
1221
1216
|
* {@link Ruler.before}, {@link Ruler.after}.
|
|
1222
1217
|
*
|
|
1223
|
-
* @param ruleName Name of added rule.
|
|
1224
|
-
* @param fn Rule function.
|
|
1225
|
-
* @param options Rule options. `alt` is an array with names of "alternate"
|
|
1226
|
-
* chains.
|
|
1227
|
-
*
|
|
1228
1218
|
* @example
|
|
1229
1219
|
* ```javascript
|
|
1230
1220
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -1250,9 +1240,7 @@ var Ruler = class {
|
|
|
1250
1240
|
*
|
|
1251
1241
|
* See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
|
|
1252
1242
|
*
|
|
1253
|
-
*
|
|
1254
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
1255
|
-
* @returns List of found rule names (if no exception happened).
|
|
1243
|
+
* Returns list of found rule names (if no exception happened).
|
|
1256
1244
|
*/
|
|
1257
1245
|
enable(list, ignoreInvalid = false) {
|
|
1258
1246
|
if (!Array.isArray(list)) list = [list];
|
|
@@ -1274,9 +1262,6 @@ var Ruler = class {
|
|
|
1274
1262
|
* not found - throw Error. Errors can be disabled by second param.
|
|
1275
1263
|
*
|
|
1276
1264
|
* See also {@link Ruler.disable}, {@link Ruler.enable}.
|
|
1277
|
-
*
|
|
1278
|
-
* @param list List of rule names to enable (whitelist).
|
|
1279
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
1280
1265
|
*/
|
|
1281
1266
|
enableOnly(list, ignoreInvalid = false) {
|
|
1282
1267
|
if (!Array.isArray(list)) list = [list];
|
|
@@ -1291,9 +1276,7 @@ var Ruler = class {
|
|
|
1291
1276
|
*
|
|
1292
1277
|
* See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
|
|
1293
1278
|
*
|
|
1294
|
-
*
|
|
1295
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
1296
|
-
* @returns List of found rule names (if no exception happened).
|
|
1279
|
+
* Returns list of found rule names (if no exception happened).
|
|
1297
1280
|
*/
|
|
1298
1281
|
disable(list, ignoreInvalid = false) {
|
|
1299
1282
|
if (!Array.isArray(list)) list = [list];
|
|
@@ -1433,10 +1416,6 @@ var Renderer = class {
|
|
|
1433
1416
|
/**
|
|
1434
1417
|
* Default token renderer. Can be overriden by custom function
|
|
1435
1418
|
* in {@link Renderer.rules}.
|
|
1436
|
-
*
|
|
1437
|
-
* @param tokens List of tokens.
|
|
1438
|
-
* @param idx Token index to render.
|
|
1439
|
-
* @param options Params of parser instance.
|
|
1440
1419
|
*/
|
|
1441
1420
|
renderToken(tokens, idx, options) {
|
|
1442
1421
|
const token = tokens[idx];
|
|
@@ -1466,10 +1445,6 @@ var Renderer = class {
|
|
|
1466
1445
|
}
|
|
1467
1446
|
/**
|
|
1468
1447
|
* The same as {@link Renderer.render}, but for single token of `inline` type.
|
|
1469
|
-
*
|
|
1470
|
-
* @param tokens List on block tokens to render.
|
|
1471
|
-
* @param options Params of parser instance.
|
|
1472
|
-
* @param env Additional data from parsed input (references, for example).
|
|
1473
1448
|
*/
|
|
1474
1449
|
renderInline(tokens, options, env) {
|
|
1475
1450
|
let result = "";
|
|
@@ -1485,10 +1460,6 @@ var Renderer = class {
|
|
|
1485
1460
|
* Special kludge for image `alt` attributes to conform CommonMark spec.
|
|
1486
1461
|
* Don't try to use it! Spec requires to show `alt` content with stripped markup,
|
|
1487
1462
|
* instead of simple escaping.
|
|
1488
|
-
*
|
|
1489
|
-
* @param tokens List on block tokens to render.
|
|
1490
|
-
* @param options Params of parser instance.
|
|
1491
|
-
* @param env Additional data from parsed input (references, for example).
|
|
1492
1463
|
*/
|
|
1493
1464
|
renderInlineAsText(tokens, options, env) {
|
|
1494
1465
|
let result = "";
|
|
@@ -1512,10 +1483,6 @@ var Renderer = class {
|
|
|
1512
1483
|
/**
|
|
1513
1484
|
* Takes token stream and generates HTML. Probably, you will never need to call
|
|
1514
1485
|
* this method directly.
|
|
1515
|
-
*
|
|
1516
|
-
* @param tokens List on block tokens to render.
|
|
1517
|
-
* @param options Params of parser instance.
|
|
1518
|
-
* @param env Additional data from parsed input (references, for example).
|
|
1519
1486
|
*/
|
|
1520
1487
|
render(tokens, options, env) {
|
|
1521
1488
|
let result = "";
|
|
@@ -1544,11 +1511,11 @@ var StateCore = class {
|
|
|
1544
1511
|
};
|
|
1545
1512
|
//#endregion
|
|
1546
1513
|
//#region src/rules_core/normalize.ts
|
|
1547
|
-
var
|
|
1514
|
+
var UNNORMALIZED_NEWLINE_RE = /\r\n?/g;
|
|
1548
1515
|
var NULL_RE = /\0/g;
|
|
1549
1516
|
function normalize(state) {
|
|
1550
1517
|
let str;
|
|
1551
|
-
str = state.src.replace(
|
|
1518
|
+
str = state.src.replace(UNNORMALIZED_NEWLINE_RE, "\n");
|
|
1552
1519
|
str = str.replace(NULL_RE, "�");
|
|
1553
1520
|
state.src = str;
|
|
1554
1521
|
}
|
|
@@ -1598,7 +1565,8 @@ function linkify$1(state) {
|
|
|
1598
1565
|
if (!state.md.options.linkify) return;
|
|
1599
1566
|
for (let j = 0, l = blockTokens.length; j < l; j++) {
|
|
1600
1567
|
if (blockTokens[j].type !== "inline" || !state.md.linkify.test(blockTokens[j].content)) continue;
|
|
1601
|
-
|
|
1568
|
+
const tokens = blockTokens[j].children;
|
|
1569
|
+
const replacements = [];
|
|
1602
1570
|
let htmlLinkLevel = 0;
|
|
1603
1571
|
for (let i = tokens.length - 1; i >= 0; i--) {
|
|
1604
1572
|
const currentToken = tokens[i];
|
|
@@ -1657,9 +1625,28 @@ function linkify$1(state) {
|
|
|
1657
1625
|
token.level = level;
|
|
1658
1626
|
nodes.push(token);
|
|
1659
1627
|
}
|
|
1660
|
-
|
|
1628
|
+
replacements.push({
|
|
1629
|
+
index: i,
|
|
1630
|
+
nodes
|
|
1631
|
+
});
|
|
1661
1632
|
}
|
|
1662
1633
|
}
|
|
1634
|
+
if (replacements.length > 0) {
|
|
1635
|
+
let newTokensLength = tokens.length;
|
|
1636
|
+
for (const replacement of replacements) newTokensLength += replacement.nodes.length - 1;
|
|
1637
|
+
const newTokens = new Array(newTokensLength);
|
|
1638
|
+
let replacementIndex = 0;
|
|
1639
|
+
let newTokenIndex = 0;
|
|
1640
|
+
replacements.reverse();
|
|
1641
|
+
for (let i = 0; i < tokens.length; i++) {
|
|
1642
|
+
const replacement = replacements[replacementIndex];
|
|
1643
|
+
if ((replacement === null || replacement === void 0 ? void 0 : replacement.index) === i) {
|
|
1644
|
+
for (const node of replacement.nodes) newTokens[newTokenIndex++] = node;
|
|
1645
|
+
replacementIndex++;
|
|
1646
|
+
} else newTokens[newTokenIndex++] = tokens[i];
|
|
1647
|
+
}
|
|
1648
|
+
blockTokens[j].children = newTokens;
|
|
1649
|
+
}
|
|
1663
1650
|
}
|
|
1664
1651
|
}
|
|
1665
1652
|
//#endregion
|
|
@@ -3142,7 +3129,12 @@ function text(state, silent) {
|
|
|
3142
3129
|
}
|
|
3143
3130
|
//#endregion
|
|
3144
3131
|
//#region src/rules_inline/linkify.ts
|
|
3145
|
-
|
|
3132
|
+
function isAsciiAlpha(code) {
|
|
3133
|
+
return code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
3134
|
+
}
|
|
3135
|
+
function isSchemeChar(code) {
|
|
3136
|
+
return code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 45 || code === 46;
|
|
3137
|
+
}
|
|
3146
3138
|
function linkify(state, silent) {
|
|
3147
3139
|
if (!state.md.options.linkify) return false;
|
|
3148
3140
|
if (state.linkLevel > 0) return false;
|
|
@@ -3152,20 +3144,22 @@ function linkify(state, silent) {
|
|
|
3152
3144
|
if (state.src.charCodeAt(pos) !== 58) return false;
|
|
3153
3145
|
if (state.src.charCodeAt(pos + 1) !== 47) return false;
|
|
3154
3146
|
if (state.src.charCodeAt(pos + 2) !== 47) return false;
|
|
3155
|
-
const
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3147
|
+
const protoMin = pos - Math.min(10, state.pending.length, pos);
|
|
3148
|
+
let protoStart = pos;
|
|
3149
|
+
while (protoStart > protoMin && isSchemeChar(state.src.charCodeAt(protoStart - 1))) protoStart--;
|
|
3150
|
+
if (protoStart === pos || !isAsciiAlpha(state.src.charCodeAt(protoStart))) return false;
|
|
3151
|
+
const protoLength = pos - protoStart;
|
|
3152
|
+
const link = state.md.linkify.matchAtStart(state.src.slice(protoStart));
|
|
3159
3153
|
if (!link) return false;
|
|
3160
3154
|
let url = link.url;
|
|
3161
|
-
if (url.length <=
|
|
3155
|
+
if (url.length <= protoLength) return false;
|
|
3162
3156
|
let urlEnd = url.length;
|
|
3163
3157
|
while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) urlEnd--;
|
|
3164
3158
|
if (urlEnd !== url.length) url = url.slice(0, urlEnd);
|
|
3165
3159
|
const fullUrl = state.md.normalizeLink(url);
|
|
3166
3160
|
if (!state.md.validateLink(fullUrl)) return false;
|
|
3167
3161
|
if (!silent) {
|
|
3168
|
-
state.pending = state.pending.slice(0, -
|
|
3162
|
+
state.pending = state.pending.slice(0, -protoLength);
|
|
3169
3163
|
const token_o = state.push("link_open", "a", 1);
|
|
3170
3164
|
token_o.attrs = [["href", fullUrl]];
|
|
3171
3165
|
token_o.markup = "linkify";
|
|
@@ -3176,7 +3170,7 @@ function linkify(state, silent) {
|
|
|
3176
3170
|
token_c.markup = "linkify";
|
|
3177
3171
|
token_c.info = "auto";
|
|
3178
3172
|
}
|
|
3179
|
-
state.pos += url.length -
|
|
3173
|
+
state.pos += url.length - protoLength;
|
|
3180
3174
|
return true;
|
|
3181
3175
|
}
|
|
3182
3176
|
//#endregion
|
|
@@ -3257,40 +3251,51 @@ function escape(state, silent) {
|
|
|
3257
3251
|
}
|
|
3258
3252
|
//#endregion
|
|
3259
3253
|
//#region src/rules_inline/backticks.ts
|
|
3254
|
+
function buildLastRuns(src) {
|
|
3255
|
+
const lastRuns = {};
|
|
3256
|
+
let pos = 0;
|
|
3257
|
+
while ((pos = src.indexOf("`", pos)) !== -1) {
|
|
3258
|
+
const start = pos;
|
|
3259
|
+
while (src.charCodeAt(++pos) === 96);
|
|
3260
|
+
lastRuns[pos - start] = start;
|
|
3261
|
+
}
|
|
3262
|
+
return lastRuns;
|
|
3263
|
+
}
|
|
3260
3264
|
function backtick(state, silent) {
|
|
3261
|
-
|
|
3262
|
-
|
|
3263
|
-
|
|
3264
|
-
pos++;
|
|
3265
|
+
var _state$backticks$open;
|
|
3266
|
+
const start = state.pos;
|
|
3267
|
+
if (state.src.charCodeAt(start) !== 96) return false;
|
|
3265
3268
|
const max = state.posMax;
|
|
3269
|
+
let pos = start + 1;
|
|
3266
3270
|
while (pos < max && state.src.charCodeAt(pos) === 96) pos++;
|
|
3267
3271
|
const marker = state.src.slice(start, pos);
|
|
3268
3272
|
const openerLength = marker.length;
|
|
3269
|
-
if (state.backticksScanned
|
|
3270
|
-
|
|
3271
|
-
state.
|
|
3272
|
-
|
|
3273
|
-
|
|
3274
|
-
|
|
3275
|
-
|
|
3276
|
-
|
|
3277
|
-
|
|
3278
|
-
|
|
3279
|
-
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
|
|
3273
|
+
if (!state.backticksScanned) {
|
|
3274
|
+
state.backticks = buildLastRuns(state.src);
|
|
3275
|
+
state.backticksScanned = true;
|
|
3276
|
+
}
|
|
3277
|
+
if (((_state$backticks$open = state.backticks[openerLength]) !== null && _state$backticks$open !== void 0 ? _state$backticks$open : -1) >= pos) {
|
|
3278
|
+
let matchEnd = pos;
|
|
3279
|
+
let matchStart;
|
|
3280
|
+
while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1 && matchStart < max) {
|
|
3281
|
+
matchEnd = matchStart + 1;
|
|
3282
|
+
while (state.src.charCodeAt(matchEnd) === 96) matchEnd++;
|
|
3283
|
+
if (matchEnd > max) break;
|
|
3284
|
+
if (matchEnd - matchStart === openerLength) {
|
|
3285
|
+
if (!silent) {
|
|
3286
|
+
const token = state.push("code_inline", "code", 0);
|
|
3287
|
+
token.markup = marker;
|
|
3288
|
+
let content = state.src.slice(pos, matchStart).replace(/\n/g, " ");
|
|
3289
|
+
if (content.startsWith(" ") && content.endsWith(" ") && /[^ ]/.test(content)) content = content.slice(1, -1);
|
|
3290
|
+
token.content = content;
|
|
3291
|
+
}
|
|
3292
|
+
state.pos = matchEnd;
|
|
3293
|
+
return true;
|
|
3285
3294
|
}
|
|
3286
|
-
state.pos = matchEnd;
|
|
3287
|
-
return true;
|
|
3288
3295
|
}
|
|
3289
|
-
state.backticks[closerLength] = matchStart;
|
|
3290
3296
|
}
|
|
3291
|
-
state.backticksScanned = true;
|
|
3292
3297
|
if (!silent) state.pending += marker;
|
|
3293
|
-
state.pos
|
|
3298
|
+
state.pos = pos;
|
|
3294
3299
|
return true;
|
|
3295
3300
|
}
|
|
3296
3301
|
//#endregion
|
|
@@ -4091,7 +4096,12 @@ var MarkdownIt = class {
|
|
|
4091
4096
|
parsed.hostname = punycode_js.default.toASCII(parsed.hostname);
|
|
4092
4097
|
} catch (er) {}
|
|
4093
4098
|
}
|
|
4094
|
-
|
|
4099
|
+
if (parsed.auth) parsed.auth = mdurl.encode(parsed.auth);
|
|
4100
|
+
if (parsed.hostname) parsed.hostname = mdurl.encode(parsed.hostname);
|
|
4101
|
+
if (parsed.pathname) parsed.pathname = mdurl.encode(parsed.pathname);
|
|
4102
|
+
if (parsed.search) parsed.search = mdurl.encode(parsed.search);
|
|
4103
|
+
if (parsed.hash) parsed.hash = mdurl.encode(parsed.hash);
|
|
4104
|
+
return mdurl.format(parsed);
|
|
4095
4105
|
}
|
|
4096
4106
|
/**
|
|
4097
4107
|
* Function used to decode link url to a human-readable format`
|
|
@@ -4259,9 +4269,6 @@ var MarkdownIt = class {
|
|
|
4259
4269
|
* containing rules with given names. If rule not found, and `ignoreInvalid`
|
|
4260
4270
|
* not set - throws exception.
|
|
4261
4271
|
*
|
|
4262
|
-
* @param list Rule name or list of rule names to enable.
|
|
4263
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
4264
|
-
*
|
|
4265
4272
|
* @example
|
|
4266
4273
|
* ```javascript
|
|
4267
4274
|
* import MarkdownIt from 'markdown-it'
|
|
@@ -4288,9 +4295,6 @@ var MarkdownIt = class {
|
|
|
4288
4295
|
}
|
|
4289
4296
|
/**
|
|
4290
4297
|
* The same as {@link MarkdownIt.enable}, but turn specified rules off.
|
|
4291
|
-
*
|
|
4292
|
-
* @param list Rule name or list of rule names to disable.
|
|
4293
|
-
* @param ignoreInvalid Set `true` to ignore errors when rule not found.
|
|
4294
4298
|
*/
|
|
4295
4299
|
disable(list, ignoreInvalid = false) {
|
|
4296
4300
|
let result = [];
|
|
@@ -4336,9 +4340,6 @@ var MarkdownIt = class {
|
|
|
4336
4340
|
* metadata like reference info, needed for the renderer. It also can be used to
|
|
4337
4341
|
* inject data in specific cases. Usually, you will be ok to pass `{}`,
|
|
4338
4342
|
* and then pass updated object to renderer.
|
|
4339
|
-
*
|
|
4340
|
-
* @param src Source string.
|
|
4341
|
-
* @param env Environment sandbox.
|
|
4342
4343
|
*/
|
|
4343
4344
|
parse(src, env) {
|
|
4344
4345
|
if (typeof src !== "string") throw new Error("Input data should be a String");
|
|
@@ -4352,9 +4353,6 @@ var MarkdownIt = class {
|
|
|
4352
4353
|
* `env` can be used to inject additional metadata (`{}` by default).
|
|
4353
4354
|
* But you will not need it with high probability. See also comment
|
|
4354
4355
|
* in {@link MarkdownIt.parse}.
|
|
4355
|
-
*
|
|
4356
|
-
* @param src Source string.
|
|
4357
|
-
* @param env Environment sandbox.
|
|
4358
4356
|
*/
|
|
4359
4357
|
render(src, env = {}) {
|
|
4360
4358
|
return this.renderer.render(this.parse(src, env), this.options, env);
|
|
@@ -4363,9 +4361,6 @@ var MarkdownIt = class {
|
|
|
4363
4361
|
* The same as {@link MarkdownIt.parse} but skip all block rules. It returns
|
|
4364
4362
|
* the block tokens list with the single `inline` element, containing parsed
|
|
4365
4363
|
* inline tokens in `children` property. Also updates `env` object.
|
|
4366
|
-
*
|
|
4367
|
-
* @param src Source string.
|
|
4368
|
-
* @param env Environment sandbox.
|
|
4369
4364
|
*/
|
|
4370
4365
|
parseInline(src, env) {
|
|
4371
4366
|
const state = new this.core.State(src, this, env);
|
|
@@ -4376,9 +4371,6 @@ var MarkdownIt = class {
|
|
|
4376
4371
|
/**
|
|
4377
4372
|
* Similar to {@link MarkdownIt.render} but for single paragraph content.
|
|
4378
4373
|
* Result will NOT be wrapped into `<p>` tags.
|
|
4379
|
-
*
|
|
4380
|
-
* @param src Source string.
|
|
4381
|
-
* @param env Environment sandbox.
|
|
4382
4374
|
*/
|
|
4383
4375
|
renderInline(src, env = {}) {
|
|
4384
4376
|
return this.renderer.render(this.parseInline(src, env), this.options, env);
|