@openclaw/matrix 2026.7.2-beta.7 → 2026.7.34
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/README.md +1 -1
- package/dist/{account-selection-kqquRzCf.js → .setup/account-selection-BOQeTqax.mjs} +18 -17
- package/dist/{approval-handler.runtime-DSeaIsGa.js → .setup/approval-handler.runtime-CEXm9_-p.mjs} +18 -28
- package/dist/{approval-ids-BdJGPAJT.js → .setup/approval-ids-DdFnDB3h.mjs} +1 -1
- package/dist/{approval-reaction-auth-BjOpELxu.js → .setup/approval-reaction-auth-CREvd7S7.mjs} +2 -2
- package/dist/.setup/approval-reactions-Cltyp8nL.mjs +113 -0
- package/dist/.setup/async-lock-BcLS4KOc.mjs +19 -0
- package/dist/{channel-vj788dNZ.js → .setup/channel-an4umty1.mjs} +186 -144
- package/dist/{channel.runtime-CLoF2S9T.js → .setup/channel.runtime-GHcIBJ7H.mjs} +51 -45
- package/dist/{cli-DMqfDE-q.js → .setup/cli-B3WYmv5U.mjs} +882 -901
- package/dist/{cli-metadata-C7D53SND.js → .setup/cli-metadata-RUKCn0wJ.mjs} +1 -1
- package/dist/{client-6eRENr7k.js → .setup/client-Ct0bUHCo.mjs} +5 -5
- package/dist/{shared-CUMWxcMz.js → .setup/client-DFBQtzCe.mjs} +422 -179
- package/dist/.setup/client-bootstrap-Be8jvNle.mjs +74 -0
- package/dist/{config-schema-Djxw3C6b.js → .setup/config-schema-D9J_vUF6.mjs} +89 -70
- package/dist/.setup/credentials-BhZlA0kL.mjs +56 -0
- package/dist/.setup/credentials-read-CRHg6XPm.mjs +114 -0
- package/dist/{credentials-write.runtime-Be9zNSUw.js → .setup/credentials-write.runtime-dWuLafsk.mjs} +1 -1
- package/dist/{crypto-runtime-D9_6J5tZ.js → .setup/crypto-runtime-D-cZa8P0.mjs} +81 -35
- package/dist/.setup/crypto-state-store-B43k3z3W.mjs +352 -0
- package/dist/{deps-CcVJfvRM.js → .setup/deps-Dy6yreL4.mjs} +92 -25
- package/dist/{device-health-B4-YXtJR.js → .setup/device-health-D4LBxuPq.mjs} +1 -6
- package/dist/{directory-live-C8dVBiCc.js → .setup/directory-live-BTEYxMwy.mjs} +10 -9
- package/dist/.setup/doctor-BGnvMzOR.mjs +169 -0
- package/dist/.setup/doctor-contract-DNJw0fdq.mjs +246 -0
- package/dist/{draft-stream-CtvOXq0Z.js → .setup/draft-stream-C-_OhpE8.mjs} +1 -6
- package/dist/{encryption-guidance-CbEFe38F.js → .setup/encryption-guidance-CpuuwmjL.mjs} +4 -3
- package/dist/{env-auth-CQsYbz-p.js → .setup/env-auth-CYJL1jNl.mjs} +2 -2
- package/dist/{env-vars-B0NxQnPk.js → .setup/env-vars-KzaYveuy.mjs} +1 -3
- package/dist/{exec-approval-resolver-BCgqRtZS.js → .setup/exec-approval-resolver-f9j6staN.mjs} +1 -2
- package/dist/{file-sync-store-DiiFsayX.js → .setup/file-sync-store-DU0cnYAz.mjs} +30 -25
- package/dist/{http-client-CycYxU9-.js → .setup/http-client-C954In2D.mjs} +45 -25
- package/dist/{idb-persistence-B6x7dMsF.js → .setup/idb-persistence-_HKTXkVC.mjs} +76 -78
- package/dist/{idb-persistence-lock-DAJ49nZX.js → .setup/idb-persistence-lock-B3fZXyF_.mjs} +1 -1
- package/dist/.setup/legacy-crypto-inspector-Byp8LCys.mjs +42 -0
- package/dist/.setup/legacy-crypto-restore-YQVoK1B2.mjs +93 -0
- package/dist/{logger-D0GCSDQq.js → .setup/logger-DpoogOgz.mjs} +1 -1
- package/dist/{logging-DV-p52N0.js → .setup/logging-CgxQOJJP.mjs} +2 -9
- package/dist/.setup/matrix-migration.runtime-BDH5c3fN.mjs +530 -0
- package/dist/{media-text-BTwzADS_.js → .setup/media-text-Cib-dxkn.mjs} +1 -1
- package/dist/{messages-DxQJkhxs.js → .setup/messages-D4DYGHYX.mjs} +15 -67
- package/dist/.setup/migration-snapshot-backup-CpgYhiUp.mjs +70 -0
- package/dist/.setup/migration-snapshot.runtime-O8qkMVaC.mjs +2 -0
- package/dist/{monitor-VyWlSLwo.js → .setup/monitor-DNcW_oAN.mjs} +2525 -2361
- package/dist/.setup/probe.runtime-CMPh0mFk.mjs +2 -0
- package/dist/{profile-update-CffmyW_4.js → .setup/profile-update-DzOL3Wiw.mjs} +5 -4
- package/dist/{reaction-events-B00WSi98.js → .setup/reaction-events-BcvgXxHb.mjs} +14 -64
- package/dist/{resolve-targets-nm2L48sh.js → .setup/resolve-targets-Bq80X9Sn.mjs} +3 -3
- package/dist/{resolver.runtime-DS6uPaEe.js → .setup/resolver.runtime-CeBHR9-T.mjs} +1 -1
- package/dist/{runtime-api-D1xI_cvh.js → .setup/runtime-api-CEsWNdil.mjs} +4 -4
- package/dist/.setup/runtime-setter-api-DGMubGUq.mjs +3 -0
- package/dist/{sdk-bUytQHx7.js → .setup/sdk-He1quVAq.mjs} +592 -261
- package/dist/.setup/secret-contract-api-CiTJ7pd5.mjs +3 -0
- package/dist/{secret-contract-M3hRmGO-.js → .setup/secret-contract-phPvlNfV.mjs} +53 -28
- package/dist/{send-BldGYG8g.js → .setup/send-CGgl0uTn.mjs} +133 -660
- package/dist/{setup-bootstrap-Deleiibz.js → .setup/setup-bootstrap-DUXBC8X2.mjs} +4 -4
- package/dist/{setup-core-BVfBv2ai.js → .setup/setup-core-bhdcEo7v.mjs} +239 -189
- package/dist/.setup/setup-plugin-api-CAwZ_Bi7.mjs +43 -0
- package/dist/.setup/setup-plugin-api-DIFVsOs3.mjs +2 -0
- package/dist/{setup-surface-BBq3WeqX.js → .setup/setup-surface-05_G-MnT.mjs} +149 -92
- package/dist/{startup-verification-wm3_i88s.js → .setup/startup-verification-BTwIGu1J.mjs} +7 -6
- package/dist/.setup/storage-NGZq5zet.mjs +432 -0
- package/dist/{storage-paths-gUmSydsW.js → .setup/storage-paths-BWo_ZEMC.mjs} +13 -2
- package/dist/{subagent-hooks-dkPAF6Et.js → .setup/subagent-hooks-BSWPJEmo.mjs} +2 -2
- package/dist/{thread-binding-api-DRbBZlhS.js → .setup/thread-binding-api-B7UaOoKv.mjs} +1 -1
- package/dist/{thread-bindings-DGbl3vDW.js → .setup/thread-bindings-DqmjG2on.mjs} +8 -8
- package/dist/{tool-actions.runtime-uu9blSqO.js → .setup/tool-actions.runtime-CXDLk2jg.mjs} +196 -332
- package/dist/{verification-DYMQ1QpI.js → .setup/verification-DeWOtZJr.mjs} +4 -3
- package/dist/api.js +9 -9
- package/dist/auth-presence.js +21 -13
- package/dist/channel-plugin-api.js +1 -1
- package/dist/cli-metadata.js +1 -1
- package/dist/contract-api.js +2 -2
- package/dist/doctor-contract-api.js +99 -524
- package/dist/helper-api.js +4 -4
- package/dist/index.js +1 -1
- package/dist/plugin-entry.handlers.runtime.js +2 -2
- package/dist/runtime-api.js +8 -8
- package/dist/runtime-heavy-api.js +3 -0
- package/dist/runtime-setter-api.js +1 -1
- package/dist/secret-contract-api.js +1 -1
- package/dist/session-binding-contract-api.js +3 -3
- package/dist/setup-entry.js +4 -3
- package/dist/setup-plugin-api.js +1 -44
- package/dist/subagent-hooks-api.js +1 -1
- package/dist/thread-binding-api.js +1 -1
- package/dist/thread-bindings-runtime.js +1 -1
- 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 +2 -14
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +384 -409
- package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +224 -246
- 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 +58 -59
- package/node_modules/markdown-it/README.md +18 -294
- package/node_modules/markdown-it/bin/markdown-it.mjs +2 -2
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +3013 -0
- package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -0
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +14 -0
- package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.cjs.js +4420 -0
- package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -0
- package/node_modules/markdown-it/dist/markdown-it.d.cts +19 -0
- package/node_modules/markdown-it/dist/markdown-it.d.mts +950 -0
- package/node_modules/markdown-it/dist/{index.cjs.js → markdown-it.mjs} +1504 -1525
- package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -0
- package/node_modules/markdown-it/node_modules/argparse/LICENSE +1 -208
- package/node_modules/markdown-it/node_modules/argparse/README.md +46 -41
- package/node_modules/markdown-it/node_modules/argparse/lib/_colorize.js +72 -0
- package/node_modules/markdown-it/node_modules/argparse/lib/argparse.d.ts +292 -0
- package/node_modules/markdown-it/node_modules/argparse/{argparse.js → lib/argparse.js} +1142 -1029
- package/node_modules/markdown-it/node_modules/argparse/lib/difflib.js +190 -0
- package/node_modules/markdown-it/node_modules/argparse/lib/sub.js +4 -4
- package/node_modules/markdown-it/node_modules/argparse/lib/textwrap.js +28 -28
- package/node_modules/markdown-it/node_modules/argparse/package.json +18 -11
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts +8 -0
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js +46 -0
- package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib → dist}/decode.d.ts +28 -45
- package/node_modules/markdown-it/node_modules/entities/dist/decode.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/decode.js +189 -141
- package/node_modules/markdown-it/node_modules/entities/dist/decode.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/encode.d.ts +4 -2
- package/node_modules/markdown-it/node_modules/entities/dist/encode.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/encode.js +90 -0
- package/node_modules/markdown-it/node_modules/entities/dist/encode.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib → dist}/escape.d.ts +15 -10
- package/node_modules/markdown-it/node_modules/entities/dist/escape.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/escape.js +132 -0
- package/node_modules/markdown-it/node_modules/entities/dist/escape.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts +3 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js +5 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts +3 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js +5 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts +5 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js +12 -0
- package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/index.d.ts +14 -21
- package/node_modules/markdown-it/node_modules/entities/dist/index.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/index.js +91 -0
- package/node_modules/markdown-it/node_modules/entities/dist/index.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts +17 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js +18 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts +7 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js +17 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts +33 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js +93 -0
- package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js.map +1 -0
- package/node_modules/markdown-it/node_modules/entities/package.json +63 -70
- package/node_modules/markdown-it/node_modules/entities/readme.md +54 -45
- package/node_modules/markdown-it/node_modules/entities/src/decode-codepoint.ts +50 -0
- package/node_modules/markdown-it/node_modules/entities/src/decode.ts +671 -0
- package/node_modules/markdown-it/node_modules/entities/src/encode.ts +95 -0
- package/node_modules/markdown-it/node_modules/entities/src/escape.ts +160 -0
- package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-html.ts +7 -0
- package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-xml.ts +7 -0
- package/node_modules/markdown-it/node_modules/entities/src/generated/encode-html.ts +18 -0
- package/node_modules/markdown-it/node_modules/entities/src/index.ts +162 -0
- package/node_modules/markdown-it/node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
- package/node_modules/markdown-it/node_modules/entities/src/internal/decode-shared.ts +18 -0
- package/node_modules/markdown-it/node_modules/entities/src/internal/encode-shared.ts +123 -0
- package/node_modules/markdown-it/node_modules/linkify-it/README.md +49 -86
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js +636 -825
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js.map +1 -0
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.d.ts +236 -0
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs +538 -0
- package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs.map +1 -0
- package/node_modules/markdown-it/node_modules/linkify-it/package.json +23 -20
- package/node_modules/markdown-it/node_modules/uc.micro/README.md +18 -1
- package/node_modules/markdown-it/node_modules/uc.micro/build/index.cjs.js +13 -18
- package/node_modules/markdown-it/node_modules/uc.micro/build/index.d.ts +6 -0
- package/node_modules/markdown-it/node_modules/uc.micro/build/index.mjs +8 -0
- package/node_modules/markdown-it/node_modules/uc.micro/package.json +12 -17
- package/node_modules/markdown-it/package.json +47 -30
- package/node_modules/matrix-js-sdk/CHANGELOG.md +0 -11
- package/node_modules/matrix-js-sdk/package.json +1 -1
- package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
- package/node_modules/music-metadata/lib/common/Util.js +1 -7
- package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +3 -23
- package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
- package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
- package/node_modules/music-metadata/lib/mp4/AtomToken.js +13 -38
- package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
- package/node_modules/music-metadata/package.json +6 -6
- package/node_modules/typebox/build/compile/validator.d.mts +4 -1
- package/node_modules/typebox/build/guard/guard.d.mts +1 -1
- package/node_modules/typebox/build/guard/guard.mjs +2 -5
- package/node_modules/typebox/build/guard/string.mjs +4 -16
- package/node_modules/typebox/build/schema/engine/_functions.mjs +15 -34
- package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
- package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -8
- package/node_modules/typebox/build/typebox.d.mts +1 -1
- package/node_modules/typebox/build/typebox.mjs +1 -1
- package/node_modules/typebox/package.json +1 -1
- package/node_modules/typebox/readme.md +32 -29
- package/openclaw.plugin.json +146 -152
- package/package.json +31 -114
- package/dist/accounts-DfngqebB.js +0 -130
- package/dist/active-client-DXvz2gCo.js +0 -20
- package/dist/approval-reactions-D-BxBK_L.js +0 -202
- package/dist/client-Dbso3-0V.js +0 -30
- package/dist/client-bootstrap-XsIkHNt0.js +0 -110
- package/dist/create-client-BmSU-q-D.js +0 -61
- package/dist/credentials-W2EmwRhu.js +0 -65
- package/dist/credentials-read-DVmFCm7X.js +0 -77
- package/dist/doctor-CM8ijNpW.js +0 -64
- package/dist/doctor-contract-BMSJkkAE.js +0 -167
- package/dist/inbound-dedupe-CaBLblef.js +0 -48
- package/dist/probe.runtime-BuieqmS3.js +0 -3
- package/dist/record-shared-CWWx6fvI.js +0 -2
- package/dist/recovery-key-store-BNnHvXdk.js +0 -275
- package/dist/room-info-CAFZ3Z9J.js +0 -87
- package/dist/route-DY6at4qJ.js +0 -161
- package/dist/storage-BvAkgzvT.js +0 -685
- package/node_modules/markdown-it/dist/index.cjs.js.map +0 -1
- package/node_modules/markdown-it/dist/markdown-it.js +0 -3975
- package/node_modules/markdown-it/dist/markdown-it.js.map +0 -1
- package/node_modules/markdown-it/dist/markdown-it.min.js +0 -3
- package/node_modules/markdown-it/dist/markdown-it.min.js.map +0 -1
- package/node_modules/markdown-it/index.mjs +0 -1
- package/node_modules/markdown-it/lib/common/html_blocks.mjs +0 -67
- package/node_modules/markdown-it/lib/common/html_re.mjs +0 -25
- package/node_modules/markdown-it/lib/common/utils.mjs +0 -324
- package/node_modules/markdown-it/lib/helpers/index.mjs +0 -11
- package/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +0 -77
- package/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +0 -49
- package/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +0 -66
- package/node_modules/markdown-it/lib/index.mjs +0 -565
- package/node_modules/markdown-it/lib/parser_block.mjs +0 -134
- package/node_modules/markdown-it/lib/parser_core.mjs +0 -62
- package/node_modules/markdown-it/lib/parser_inline.mjs +0 -197
- package/node_modules/markdown-it/lib/presets/commonmark.mjs +0 -88
- package/node_modules/markdown-it/lib/presets/default.mjs +0 -47
- package/node_modules/markdown-it/lib/presets/zero.mjs +0 -70
- package/node_modules/markdown-it/lib/renderer.mjs +0 -322
- package/node_modules/markdown-it/lib/ruler.mjs +0 -340
- package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +0 -209
- package/node_modules/markdown-it/lib/rules_block/code.mjs +0 -30
- package/node_modules/markdown-it/lib/rules_block/fence.mjs +0 -94
- package/node_modules/markdown-it/lib/rules_block/heading.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_block/hr.mjs +0 -40
- package/node_modules/markdown-it/lib/rules_block/html_block.mjs +0 -80
- package/node_modules/markdown-it/lib/rules_block/lheading.mjs +0 -85
- package/node_modules/markdown-it/lib/rules_block/list.mjs +0 -331
- package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +0 -48
- package/node_modules/markdown-it/lib/rules_block/reference.mjs +0 -212
- package/node_modules/markdown-it/lib/rules_block/state_block.mjs +0 -220
- package/node_modules/markdown-it/lib/rules_block/table.mjs +0 -228
- package/node_modules/markdown-it/lib/rules_core/block.mjs +0 -13
- package/node_modules/markdown-it/lib/rules_core/inline.mjs +0 -11
- package/node_modules/markdown-it/lib/rules_core/linkify.mjs +0 -134
- package/node_modules/markdown-it/lib/rules_core/normalize.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/replacements.mjs +0 -101
- package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +0 -209
- package/node_modules/markdown-it/lib/rules_core/state_core.mjs +0 -17
- package/node_modules/markdown-it/lib/rules_core/text_join.mjs +0 -43
- package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +0 -72
- package/node_modules/markdown-it/lib/rules_inline/backticks.mjs +0 -60
- package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +0 -124
- package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +0 -123
- package/node_modules/markdown-it/lib/rules_inline/entity.mjs +0 -51
- package/node_modules/markdown-it/lib/rules_inline/escape.mjs +0 -83
- package/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +0 -38
- package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +0 -50
- package/node_modules/markdown-it/lib/rules_inline/image.mjs +0 -138
- package/node_modules/markdown-it/lib/rules_inline/link.mjs +0 -139
- package/node_modules/markdown-it/lib/rules_inline/linkify.mjs +0 -63
- package/node_modules/markdown-it/lib/rules_inline/newline.mjs +0 -42
- package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +0 -154
- package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +0 -127
- package/node_modules/markdown-it/lib/rules_inline/text.mjs +0 -86
- package/node_modules/markdown-it/lib/token.mjs +0 -191
- package/node_modules/markdown-it/node_modules/argparse/CHANGELOG.md +0 -216
- package/node_modules/markdown-it/node_modules/entities/lib/decode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/decode.js +0 -536
- package/node_modules/markdown-it/node_modules/entities/lib/decode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts +0 -19
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js +0 -76
- package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts +0 -22
- package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/encode.js +0 -77
- package/node_modules/markdown-it/node_modules/entities/lib/encode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/escape.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/escape.js +0 -122
- package/node_modules/markdown-it/node_modules/entities/lib/escape.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts +0 -211
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts +0 -19
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js +0 -71
- package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js +0 -69
- package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts +0 -43
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js +0 -116
- package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js +0 -10
- package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/index.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js +0 -99
- package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/esm/package.json +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js +0 -9
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
- package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js +0 -12
- package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts +0 -96
- package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts.map +0 -1
- package/node_modules/markdown-it/node_modules/entities/lib/index.js +0 -126
- package/node_modules/markdown-it/node_modules/entities/lib/index.js.map +0 -1
- package/node_modules/markdown-it/node_modules/linkify-it/index.mjs +0 -646
- package/node_modules/markdown-it/node_modules/linkify-it/lib/re.mjs +0 -193
- package/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/S/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
- package/node_modules/markdown-it/node_modules/uc.micro/index.mjs +0 -8
- package/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
- /package/dist/{account-config-BZWN9tGS.js → .setup/account-config-BZWN9tGS.mjs} +0 -0
- /package/dist/{backup-health-Dm_YMVFT.js → .setup/backup-health-Dm_YMVFT.mjs} +0 -0
- /package/dist/{config-paths-CnREYb1Y.js → .setup/config-paths-CnREYb1Y.mjs} +0 -0
- /package/dist/{config-secret-input.runtime-CwsP3--c.js → .setup/config-secret-input.runtime-CwsP3--c.mjs} +0 -0
- /package/dist/{crypto-node.runtime-6Aj_ltHQ.js → .setup/crypto-node.runtime-6Aj_ltHQ.mjs} +0 -0
- /package/dist/{errors-C47hvAF8.js → .setup/errors-C47hvAF8.mjs} +0 -0
- /package/dist/{preflight-audio.runtime-BZxxQsxY.js → .setup/preflight-audio.runtime-BZxxQsxY.mjs} +0 -0
- /package/dist/{reaction-common-DkrQdBSZ.js → .setup/reaction-common-DkrQdBSZ.mjs} +0 -0
- /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
- /package/dist/{runtime-6S3DNFNv.js → .setup/runtime-6S3DNFNv.mjs} +0 -0
- /package/dist/{runtime-BefyhPWv.js → .setup/runtime-BefyhPWv.mjs} +0 -0
- /package/dist/{sync-state-CWbp0QSY.js → .setup/sync-state-CWbp0QSY.mjs} +0 -0
- /package/dist/{target-ids-B-5aQxwn.js → .setup/target-ids-B-5aQxwn.mjs} +0 -0
- /package/dist/{thread-bindings-shared-CKnY4LSd.js → .setup/thread-bindings-shared-CKnY4LSd.mjs} +0 -0
- /package/dist/{timeout-abort-signal-DMrgRFIy.js → .setup/timeout-abort-signal-DMrgRFIy.mjs} +0 -0
- /package/dist/{url-validation-GRHde6lq.js → .setup/url-validation-GRHde6lq.mjs} +0 -0
|
@@ -1,101 +0,0 @@
|
|
|
1
|
-
// Simple typographic replacements
|
|
2
|
-
//
|
|
3
|
-
// (c) (C) → ©
|
|
4
|
-
// (tm) (TM) → ™
|
|
5
|
-
// (r) (R) → ®
|
|
6
|
-
// +- → ±
|
|
7
|
-
// ... → … (also ?.... → ?.., !.... → !..)
|
|
8
|
-
// ???????? → ???, !!!!! → !!!, `,,` → `,`
|
|
9
|
-
// -- → –, --- → —
|
|
10
|
-
//
|
|
11
|
-
|
|
12
|
-
// TODO:
|
|
13
|
-
// - fractionals 1/2, 1/4, 3/4 -> ½, ¼, ¾
|
|
14
|
-
// - multiplications 2 x 4 -> 2 × 4
|
|
15
|
-
|
|
16
|
-
const RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/
|
|
17
|
-
|
|
18
|
-
// Workaround for phantomjs - need regex without /g flag,
|
|
19
|
-
// or root check will fail every second time
|
|
20
|
-
const SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i
|
|
21
|
-
|
|
22
|
-
const SCOPED_ABBR_RE = /\((c|tm|r)\)/ig
|
|
23
|
-
const SCOPED_ABBR = {
|
|
24
|
-
c: '©',
|
|
25
|
-
r: '®',
|
|
26
|
-
tm: '™'
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
function replaceFn (match, name) {
|
|
30
|
-
return SCOPED_ABBR[name.toLowerCase()]
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
function replace_scoped (inlineTokens) {
|
|
34
|
-
let inside_autolink = 0
|
|
35
|
-
|
|
36
|
-
for (let i = inlineTokens.length - 1; i >= 0; i--) {
|
|
37
|
-
const token = inlineTokens[i]
|
|
38
|
-
|
|
39
|
-
if (token.type === 'text' && !inside_autolink) {
|
|
40
|
-
token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn)
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (token.type === 'link_open' && token.info === 'auto') {
|
|
44
|
-
inside_autolink--
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
if (token.type === 'link_close' && token.info === 'auto') {
|
|
48
|
-
inside_autolink++
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function replace_rare (inlineTokens) {
|
|
54
|
-
let inside_autolink = 0
|
|
55
|
-
|
|
56
|
-
for (let i = inlineTokens.length - 1; i >= 0; i--) {
|
|
57
|
-
const token = inlineTokens[i]
|
|
58
|
-
|
|
59
|
-
if (token.type === 'text' && !inside_autolink) {
|
|
60
|
-
if (RARE_RE.test(token.content)) {
|
|
61
|
-
token.content = token.content
|
|
62
|
-
.replace(/\+-/g, '±')
|
|
63
|
-
// .., ..., ....... -> …
|
|
64
|
-
// but ?..... & !..... -> ?.. & !..
|
|
65
|
-
.replace(/\.{2,}/g, '…').replace(/([?!])…/g, '$1..')
|
|
66
|
-
.replace(/([?!]){4,}/g, '$1$1$1').replace(/,{2,}/g, ',')
|
|
67
|
-
// em-dash
|
|
68
|
-
.replace(/(^|[^-])---(?=[^-]|$)/mg, '$1\u2014')
|
|
69
|
-
// en-dash
|
|
70
|
-
.replace(/(^|\s)--(?=\s|$)/mg, '$1\u2013')
|
|
71
|
-
.replace(/(^|[^-\s])--(?=[^-\s]|$)/mg, '$1\u2013')
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
if (token.type === 'link_open' && token.info === 'auto') {
|
|
76
|
-
inside_autolink--
|
|
77
|
-
}
|
|
78
|
-
|
|
79
|
-
if (token.type === 'link_close' && token.info === 'auto') {
|
|
80
|
-
inside_autolink++
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
export default function replace (state) {
|
|
86
|
-
let blkIdx
|
|
87
|
-
|
|
88
|
-
if (!state.md.options.typographer) { return }
|
|
89
|
-
|
|
90
|
-
for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
|
|
91
|
-
if (state.tokens[blkIdx].type !== 'inline') { continue }
|
|
92
|
-
|
|
93
|
-
if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) {
|
|
94
|
-
replace_scoped(state.tokens[blkIdx].children)
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
if (RARE_RE.test(state.tokens[blkIdx].content)) {
|
|
98
|
-
replace_rare(state.tokens[blkIdx].children)
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
}
|
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
// Convert straight quotation marks to typographic ones
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
import { isWhiteSpace, isPunctCharCode, isMdAsciiPunct } from '../common/utils.mjs'
|
|
5
|
-
|
|
6
|
-
const QUOTE_TEST_RE = /['"]/
|
|
7
|
-
const QUOTE_RE = /['"]/g
|
|
8
|
-
const APOSTROPHE = '\u2019' /* ’ */
|
|
9
|
-
|
|
10
|
-
function addReplacement (replacements, tokenIdx, pos, ch) {
|
|
11
|
-
if (!replacements[tokenIdx]) {
|
|
12
|
-
replacements[tokenIdx] = []
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
replacements[tokenIdx].push({ pos, ch })
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
function applyReplacements (str, replacements) {
|
|
19
|
-
let result = ''
|
|
20
|
-
let lastPos = 0
|
|
21
|
-
|
|
22
|
-
replacements.sort((a, b) => a.pos - b.pos)
|
|
23
|
-
|
|
24
|
-
for (let i = 0; i < replacements.length; i++) {
|
|
25
|
-
const replacement = replacements[i]
|
|
26
|
-
|
|
27
|
-
result += str.slice(lastPos, replacement.pos) + replacement.ch
|
|
28
|
-
lastPos = replacement.pos + 1
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
return result + str.slice(lastPos)
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
function process_inlines (tokens, state) {
|
|
35
|
-
let j
|
|
36
|
-
|
|
37
|
-
const stack = []
|
|
38
|
-
// token index -> list of replacements in the original token content
|
|
39
|
-
const replacements = {}
|
|
40
|
-
|
|
41
|
-
for (let i = 0; i < tokens.length; i++) {
|
|
42
|
-
const token = tokens[i]
|
|
43
|
-
|
|
44
|
-
const thisLevel = tokens[i].level
|
|
45
|
-
|
|
46
|
-
for (j = stack.length - 1; j >= 0; j--) {
|
|
47
|
-
if (stack[j].level <= thisLevel) { break }
|
|
48
|
-
}
|
|
49
|
-
stack.length = j + 1
|
|
50
|
-
|
|
51
|
-
if (token.type !== 'text') { continue }
|
|
52
|
-
|
|
53
|
-
const text = token.content
|
|
54
|
-
let pos = 0
|
|
55
|
-
const max = text.length
|
|
56
|
-
|
|
57
|
-
/* eslint no-labels:0,block-scoped-var:0 */
|
|
58
|
-
OUTER:
|
|
59
|
-
while (pos < max) {
|
|
60
|
-
QUOTE_RE.lastIndex = pos
|
|
61
|
-
const t = QUOTE_RE.exec(text)
|
|
62
|
-
if (!t) { break }
|
|
63
|
-
|
|
64
|
-
let canOpen = true
|
|
65
|
-
let canClose = true
|
|
66
|
-
pos = t.index + 1
|
|
67
|
-
const isSingle = (t[0] === "'")
|
|
68
|
-
|
|
69
|
-
// Find previous character,
|
|
70
|
-
// default to space if it's the beginning of the line
|
|
71
|
-
//
|
|
72
|
-
let lastChar = 0x20
|
|
73
|
-
|
|
74
|
-
if (t.index - 1 >= 0) {
|
|
75
|
-
lastChar = text.charCodeAt(t.index - 1)
|
|
76
|
-
} else {
|
|
77
|
-
for (j = i - 1; j >= 0; j--) {
|
|
78
|
-
if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // lastChar defaults to 0x20
|
|
79
|
-
if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'
|
|
80
|
-
|
|
81
|
-
lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1)
|
|
82
|
-
break
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
// Find next character,
|
|
87
|
-
// default to space if it's the end of the line
|
|
88
|
-
//
|
|
89
|
-
let nextChar = 0x20
|
|
90
|
-
|
|
91
|
-
if (pos < max) {
|
|
92
|
-
nextChar = text.charCodeAt(pos)
|
|
93
|
-
} else {
|
|
94
|
-
for (j = i + 1; j < tokens.length; j++) {
|
|
95
|
-
if (tokens[j].type === 'softbreak' || tokens[j].type === 'hardbreak') break // nextChar defaults to 0x20
|
|
96
|
-
if (!tokens[j].content) continue // should skip all tokens except 'text', 'html_inline' or 'code_inline'
|
|
97
|
-
|
|
98
|
-
nextChar = tokens[j].content.charCodeAt(0)
|
|
99
|
-
break
|
|
100
|
-
}
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar)
|
|
104
|
-
const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar)
|
|
105
|
-
|
|
106
|
-
const isLastWhiteSpace = isWhiteSpace(lastChar)
|
|
107
|
-
const isNextWhiteSpace = isWhiteSpace(nextChar)
|
|
108
|
-
|
|
109
|
-
if (isNextWhiteSpace) {
|
|
110
|
-
canOpen = false
|
|
111
|
-
} else if (isNextPunctChar) {
|
|
112
|
-
if (!(isLastWhiteSpace || isLastPunctChar)) {
|
|
113
|
-
canOpen = false
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
if (isLastWhiteSpace) {
|
|
118
|
-
canClose = false
|
|
119
|
-
} else if (isLastPunctChar) {
|
|
120
|
-
if (!(isNextWhiteSpace || isNextPunctChar)) {
|
|
121
|
-
canClose = false
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
if (nextChar === 0x22 /* " */ && t[0] === '"') {
|
|
126
|
-
if (lastChar >= 0x30 /* 0 */ && lastChar <= 0x39 /* 9 */) {
|
|
127
|
-
// special case: 1"" - count first quote as an inch
|
|
128
|
-
canClose = canOpen = false
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
if (canOpen && canClose) {
|
|
133
|
-
// Replace quotes in the middle of punctuation sequence, but not
|
|
134
|
-
// in the middle of the words, i.e.:
|
|
135
|
-
//
|
|
136
|
-
// 1. foo " bar " baz - not replaced
|
|
137
|
-
// 2. foo-"-bar-"-baz - replaced
|
|
138
|
-
// 3. foo"bar"baz - not replaced
|
|
139
|
-
//
|
|
140
|
-
canOpen = isLastPunctChar
|
|
141
|
-
canClose = isNextPunctChar
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
if (!canOpen && !canClose) {
|
|
145
|
-
// middle of word
|
|
146
|
-
if (isSingle) {
|
|
147
|
-
addReplacement(replacements, i, t.index, APOSTROPHE)
|
|
148
|
-
}
|
|
149
|
-
continue
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
if (canClose) {
|
|
153
|
-
// this could be a closing quote, rewind the stack to get a match
|
|
154
|
-
for (j = stack.length - 1; j >= 0; j--) {
|
|
155
|
-
let item = stack[j]
|
|
156
|
-
if (stack[j].level < thisLevel) { break }
|
|
157
|
-
if (item.single === isSingle && stack[j].level === thisLevel) {
|
|
158
|
-
item = stack[j]
|
|
159
|
-
|
|
160
|
-
let openQuote
|
|
161
|
-
let closeQuote
|
|
162
|
-
if (isSingle) {
|
|
163
|
-
openQuote = state.md.options.quotes[2]
|
|
164
|
-
closeQuote = state.md.options.quotes[3]
|
|
165
|
-
} else {
|
|
166
|
-
openQuote = state.md.options.quotes[0]
|
|
167
|
-
closeQuote = state.md.options.quotes[1]
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
addReplacement(replacements, i, t.index, closeQuote)
|
|
171
|
-
addReplacement(replacements, item.token, item.pos, openQuote)
|
|
172
|
-
|
|
173
|
-
stack.length = j
|
|
174
|
-
continue OUTER
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
if (canOpen) {
|
|
180
|
-
stack.push({
|
|
181
|
-
token: i,
|
|
182
|
-
pos: t.index,
|
|
183
|
-
single: isSingle,
|
|
184
|
-
level: thisLevel
|
|
185
|
-
})
|
|
186
|
-
} else if (canClose && isSingle) {
|
|
187
|
-
addReplacement(replacements, i, t.index, APOSTROPHE)
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
Object.keys(replacements).forEach(function (tokenIdx) {
|
|
193
|
-
tokens[tokenIdx].content = applyReplacements(tokens[tokenIdx].content, replacements[tokenIdx])
|
|
194
|
-
})
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
export default function smartquotes (state) {
|
|
198
|
-
/* eslint max-depth:0 */
|
|
199
|
-
if (!state.md.options.typographer) { return }
|
|
200
|
-
|
|
201
|
-
for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
|
|
202
|
-
if (state.tokens[blkIdx].type !== 'inline' ||
|
|
203
|
-
!QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) {
|
|
204
|
-
continue
|
|
205
|
-
}
|
|
206
|
-
|
|
207
|
-
process_inlines(state.tokens[blkIdx].children, state)
|
|
208
|
-
}
|
|
209
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// Core state object
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
import Token from '../token.mjs'
|
|
5
|
-
|
|
6
|
-
function StateCore (src, md, env) {
|
|
7
|
-
this.src = src
|
|
8
|
-
this.env = env
|
|
9
|
-
this.tokens = []
|
|
10
|
-
this.inlineMode = false
|
|
11
|
-
this.md = md // link to parser instance
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
// re-export Token class to use in core rules
|
|
15
|
-
StateCore.prototype.Token = Token
|
|
16
|
-
|
|
17
|
-
export default StateCore
|
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
// Join raw text tokens with the rest of the text
|
|
2
|
-
//
|
|
3
|
-
// This is set as a separate rule to provide an opportunity for plugins
|
|
4
|
-
// to run text replacements after text join, but before escape join.
|
|
5
|
-
//
|
|
6
|
-
// For example, `\:)` shouldn't be replaced with an emoji.
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
export default function text_join (state) {
|
|
10
|
-
let curr, last
|
|
11
|
-
const blockTokens = state.tokens
|
|
12
|
-
const l = blockTokens.length
|
|
13
|
-
|
|
14
|
-
for (let j = 0; j < l; j++) {
|
|
15
|
-
if (blockTokens[j].type !== 'inline') continue
|
|
16
|
-
|
|
17
|
-
const tokens = blockTokens[j].children
|
|
18
|
-
const max = tokens.length
|
|
19
|
-
|
|
20
|
-
for (curr = 0; curr < max; curr++) {
|
|
21
|
-
if (tokens[curr].type === 'text_special') {
|
|
22
|
-
tokens[curr].type = 'text'
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
for (curr = last = 0; curr < max; curr++) {
|
|
27
|
-
if (tokens[curr].type === 'text' &&
|
|
28
|
-
curr + 1 < max &&
|
|
29
|
-
tokens[curr + 1].type === 'text') {
|
|
30
|
-
// collapse two adjacent text nodes
|
|
31
|
-
tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content
|
|
32
|
-
} else {
|
|
33
|
-
if (curr !== last) { tokens[last] = tokens[curr] }
|
|
34
|
-
|
|
35
|
-
last++
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (curr !== last) {
|
|
40
|
-
tokens.length = last
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
}
|
|
@@ -1,72 +0,0 @@
|
|
|
1
|
-
// Process autolinks '<protocol:...>'
|
|
2
|
-
|
|
3
|
-
/* eslint max-len:0 */
|
|
4
|
-
const EMAIL_RE = /^([a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*)$/
|
|
5
|
-
/* eslint-disable-next-line no-control-regex */
|
|
6
|
-
const AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/
|
|
7
|
-
|
|
8
|
-
export default function autolink (state, silent) {
|
|
9
|
-
let pos = state.pos
|
|
10
|
-
|
|
11
|
-
if (state.src.charCodeAt(pos) !== 0x3C/* < */) { return false }
|
|
12
|
-
|
|
13
|
-
const start = state.pos
|
|
14
|
-
const max = state.posMax
|
|
15
|
-
|
|
16
|
-
for (;;) {
|
|
17
|
-
if (++pos >= max) return false
|
|
18
|
-
|
|
19
|
-
const ch = state.src.charCodeAt(pos)
|
|
20
|
-
|
|
21
|
-
if (ch === 0x3C /* < */) return false
|
|
22
|
-
if (ch === 0x3E /* > */) break
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
const url = state.src.slice(start + 1, pos)
|
|
26
|
-
|
|
27
|
-
if (AUTOLINK_RE.test(url)) {
|
|
28
|
-
const fullUrl = state.md.normalizeLink(url)
|
|
29
|
-
if (!state.md.validateLink(fullUrl)) { return false }
|
|
30
|
-
|
|
31
|
-
if (!silent) {
|
|
32
|
-
const token_o = state.push('link_open', 'a', 1)
|
|
33
|
-
token_o.attrs = [['href', fullUrl]]
|
|
34
|
-
token_o.markup = 'autolink'
|
|
35
|
-
token_o.info = 'auto'
|
|
36
|
-
|
|
37
|
-
const token_t = state.push('text', '', 0)
|
|
38
|
-
token_t.content = state.md.normalizeLinkText(url)
|
|
39
|
-
|
|
40
|
-
const token_c = state.push('link_close', 'a', -1)
|
|
41
|
-
token_c.markup = 'autolink'
|
|
42
|
-
token_c.info = 'auto'
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
state.pos += url.length + 2
|
|
46
|
-
return true
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (EMAIL_RE.test(url)) {
|
|
50
|
-
const fullUrl = state.md.normalizeLink('mailto:' + url)
|
|
51
|
-
if (!state.md.validateLink(fullUrl)) { return false }
|
|
52
|
-
|
|
53
|
-
if (!silent) {
|
|
54
|
-
const token_o = state.push('link_open', 'a', 1)
|
|
55
|
-
token_o.attrs = [['href', fullUrl]]
|
|
56
|
-
token_o.markup = 'autolink'
|
|
57
|
-
token_o.info = 'auto'
|
|
58
|
-
|
|
59
|
-
const token_t = state.push('text', '', 0)
|
|
60
|
-
token_t.content = state.md.normalizeLinkText(url)
|
|
61
|
-
|
|
62
|
-
const token_c = state.push('link_close', 'a', -1)
|
|
63
|
-
token_c.markup = 'autolink'
|
|
64
|
-
token_c.info = 'auto'
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
state.pos += url.length + 2
|
|
68
|
-
return true
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
return false
|
|
72
|
-
}
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
// Parse backticks
|
|
2
|
-
|
|
3
|
-
export default function backtick (state, silent) {
|
|
4
|
-
let pos = state.pos
|
|
5
|
-
const ch = state.src.charCodeAt(pos)
|
|
6
|
-
|
|
7
|
-
if (ch !== 0x60/* ` */) { return false }
|
|
8
|
-
|
|
9
|
-
const start = pos
|
|
10
|
-
pos++
|
|
11
|
-
const max = state.posMax
|
|
12
|
-
|
|
13
|
-
// scan marker length
|
|
14
|
-
while (pos < max && state.src.charCodeAt(pos) === 0x60/* ` */) { pos++ }
|
|
15
|
-
|
|
16
|
-
const marker = state.src.slice(start, pos)
|
|
17
|
-
const openerLength = marker.length
|
|
18
|
-
|
|
19
|
-
if (state.backticksScanned && (state.backticks[openerLength] || 0) <= start) {
|
|
20
|
-
if (!silent) state.pending += marker
|
|
21
|
-
state.pos += openerLength
|
|
22
|
-
return true
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
let matchEnd = pos
|
|
26
|
-
let matchStart
|
|
27
|
-
|
|
28
|
-
// Nothing found in the cache, scan until the end of the line (or until marker is found)
|
|
29
|
-
while ((matchStart = state.src.indexOf('`', matchEnd)) !== -1) {
|
|
30
|
-
matchEnd = matchStart + 1
|
|
31
|
-
|
|
32
|
-
// scan marker length
|
|
33
|
-
while (matchEnd < max && state.src.charCodeAt(matchEnd) === 0x60/* ` */) { matchEnd++ }
|
|
34
|
-
|
|
35
|
-
const closerLength = matchEnd - matchStart
|
|
36
|
-
|
|
37
|
-
if (closerLength === openerLength) {
|
|
38
|
-
// Found matching closer length.
|
|
39
|
-
if (!silent) {
|
|
40
|
-
const token = state.push('code_inline', 'code', 0)
|
|
41
|
-
token.markup = marker
|
|
42
|
-
token.content = state.src.slice(pos, matchStart)
|
|
43
|
-
.replace(/\n/g, ' ')
|
|
44
|
-
.replace(/^ (.+) $/, '$1')
|
|
45
|
-
}
|
|
46
|
-
state.pos = matchEnd
|
|
47
|
-
return true
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
// Some different length found, put it in cache as upper limit of where closer can be found
|
|
51
|
-
state.backticks[closerLength] = matchStart
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
// Scanned through the end, didn't find anything
|
|
55
|
-
state.backticksScanned = true
|
|
56
|
-
|
|
57
|
-
if (!silent) state.pending += marker
|
|
58
|
-
state.pos += openerLength
|
|
59
|
-
return true
|
|
60
|
-
}
|
|
@@ -1,124 +0,0 @@
|
|
|
1
|
-
// For each opening emphasis-like marker find a matching closing one
|
|
2
|
-
//
|
|
3
|
-
|
|
4
|
-
function processDelimiters (delimiters) {
|
|
5
|
-
const openersBottom = {}
|
|
6
|
-
const max = delimiters.length
|
|
7
|
-
|
|
8
|
-
if (!max) return
|
|
9
|
-
|
|
10
|
-
// headerIdx is the first delimiter of the current (where closer is) delimiter run
|
|
11
|
-
let headerIdx = 0
|
|
12
|
-
let lastTokenIdx = -2 // needs any value lower than -1
|
|
13
|
-
const jumps = []
|
|
14
|
-
|
|
15
|
-
for (let closerIdx = 0; closerIdx < max; closerIdx++) {
|
|
16
|
-
const closer = delimiters[closerIdx]
|
|
17
|
-
|
|
18
|
-
jumps.push(0)
|
|
19
|
-
|
|
20
|
-
// markers belong to same delimiter run if:
|
|
21
|
-
// - they have adjacent tokens
|
|
22
|
-
// - AND markers are the same
|
|
23
|
-
//
|
|
24
|
-
if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) {
|
|
25
|
-
headerIdx = closerIdx
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
lastTokenIdx = closer.token
|
|
29
|
-
|
|
30
|
-
// Length is only used for emphasis-specific "rule of 3",
|
|
31
|
-
// if it's not defined (in strikethrough or 3rd party plugins),
|
|
32
|
-
// we can default it to 0 to disable those checks.
|
|
33
|
-
//
|
|
34
|
-
closer.length = closer.length || 0
|
|
35
|
-
|
|
36
|
-
if (!closer.close) continue
|
|
37
|
-
|
|
38
|
-
// Previously calculated lower bounds (previous fails)
|
|
39
|
-
// for each marker, each delimiter length modulo 3,
|
|
40
|
-
// and for whether this closer can be an opener;
|
|
41
|
-
// https://github.com/commonmark/cmark/commit/34250e12ccebdc6372b8b49c44fab57c72443460
|
|
42
|
-
/* eslint-disable-next-line no-prototype-builtins */
|
|
43
|
-
if (!openersBottom.hasOwnProperty(closer.marker)) {
|
|
44
|
-
openersBottom[closer.marker] = [-1, -1, -1, -1, -1, -1]
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length % 3)]
|
|
48
|
-
|
|
49
|
-
let openerIdx = headerIdx - jumps[headerIdx] - 1
|
|
50
|
-
|
|
51
|
-
let newMinOpenerIdx = openerIdx
|
|
52
|
-
|
|
53
|
-
for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
|
|
54
|
-
const opener = delimiters[openerIdx]
|
|
55
|
-
|
|
56
|
-
if (opener.marker !== closer.marker) continue
|
|
57
|
-
|
|
58
|
-
if (opener.open && opener.end < 0) {
|
|
59
|
-
let isOddMatch = false
|
|
60
|
-
|
|
61
|
-
// from spec:
|
|
62
|
-
//
|
|
63
|
-
// If one of the delimiters can both open and close emphasis, then the
|
|
64
|
-
// sum of the lengths of the delimiter runs containing the opening and
|
|
65
|
-
// closing delimiters must not be a multiple of 3 unless both lengths
|
|
66
|
-
// are multiples of 3.
|
|
67
|
-
//
|
|
68
|
-
if (opener.close || closer.open) {
|
|
69
|
-
if ((opener.length + closer.length) % 3 === 0) {
|
|
70
|
-
if (opener.length % 3 !== 0 || closer.length % 3 !== 0) {
|
|
71
|
-
isOddMatch = true
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
if (!isOddMatch) {
|
|
77
|
-
// If previous delimiter cannot be an opener, we can safely skip
|
|
78
|
-
// the entire sequence in future checks. This is required to make
|
|
79
|
-
// sure algorithm has linear complexity (see *_*_*_*_*_... case).
|
|
80
|
-
//
|
|
81
|
-
const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open
|
|
82
|
-
? jumps[openerIdx - 1] + 1
|
|
83
|
-
: 0
|
|
84
|
-
|
|
85
|
-
jumps[closerIdx] = closerIdx - openerIdx + lastJump
|
|
86
|
-
jumps[openerIdx] = lastJump
|
|
87
|
-
|
|
88
|
-
closer.open = false
|
|
89
|
-
opener.end = closerIdx
|
|
90
|
-
opener.close = false
|
|
91
|
-
newMinOpenerIdx = -1
|
|
92
|
-
// treat next token as start of run,
|
|
93
|
-
// it optimizes skips in **<...>**a**<...>** pathological case
|
|
94
|
-
lastTokenIdx = -2
|
|
95
|
-
break
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
}
|
|
99
|
-
|
|
100
|
-
if (newMinOpenerIdx !== -1) {
|
|
101
|
-
// If match for this delimiter run failed, we want to set lower bound for
|
|
102
|
-
// future lookups. This is required to make sure algorithm has linear
|
|
103
|
-
// complexity.
|
|
104
|
-
//
|
|
105
|
-
// See details here:
|
|
106
|
-
// https://github.com/commonmark/cmark/issues/178#issuecomment-270417442
|
|
107
|
-
//
|
|
108
|
-
openersBottom[closer.marker][(closer.open ? 3 : 0) + ((closer.length || 0) % 3)] = newMinOpenerIdx
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
export default function link_pairs (state) {
|
|
114
|
-
const tokens_meta = state.tokens_meta
|
|
115
|
-
const max = state.tokens_meta.length
|
|
116
|
-
|
|
117
|
-
processDelimiters(state.delimiters)
|
|
118
|
-
|
|
119
|
-
for (let curr = 0; curr < max; curr++) {
|
|
120
|
-
if (tokens_meta[curr] && tokens_meta[curr].delimiters) {
|
|
121
|
-
processDelimiters(tokens_meta[curr].delimiters)
|
|
122
|
-
}
|
|
123
|
-
}
|
|
124
|
-
}
|