@openclaw/matrix 2026.7.2-beta.7 → 2026.7.33

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.
Files changed (368) hide show
  1. package/README.md +1 -1
  2. package/dist/{account-selection-kqquRzCf.js → .setup/account-selection-BOQeTqax.mjs} +18 -17
  3. package/dist/{approval-handler.runtime-DSeaIsGa.js → .setup/approval-handler.runtime-CEXm9_-p.mjs} +18 -28
  4. package/dist/{approval-ids-BdJGPAJT.js → .setup/approval-ids-DdFnDB3h.mjs} +1 -1
  5. package/dist/{approval-reaction-auth-BjOpELxu.js → .setup/approval-reaction-auth-CREvd7S7.mjs} +2 -2
  6. package/dist/.setup/approval-reactions-Cltyp8nL.mjs +113 -0
  7. package/dist/.setup/async-lock-BcLS4KOc.mjs +19 -0
  8. package/dist/{channel-vj788dNZ.js → .setup/channel-an4umty1.mjs} +186 -144
  9. package/dist/{channel.runtime-CLoF2S9T.js → .setup/channel.runtime-GHcIBJ7H.mjs} +51 -45
  10. package/dist/{cli-DMqfDE-q.js → .setup/cli-B3WYmv5U.mjs} +882 -901
  11. package/dist/{cli-metadata-C7D53SND.js → .setup/cli-metadata-RUKCn0wJ.mjs} +1 -1
  12. package/dist/{client-6eRENr7k.js → .setup/client-Ct0bUHCo.mjs} +5 -5
  13. package/dist/{shared-CUMWxcMz.js → .setup/client-DFBQtzCe.mjs} +422 -179
  14. package/dist/.setup/client-bootstrap-Be8jvNle.mjs +74 -0
  15. package/dist/{config-schema-Djxw3C6b.js → .setup/config-schema-D9J_vUF6.mjs} +89 -70
  16. package/dist/.setup/credentials-BhZlA0kL.mjs +56 -0
  17. package/dist/.setup/credentials-read-CRHg6XPm.mjs +114 -0
  18. package/dist/{credentials-write.runtime-Be9zNSUw.js → .setup/credentials-write.runtime-dWuLafsk.mjs} +1 -1
  19. package/dist/{crypto-runtime-D9_6J5tZ.js → .setup/crypto-runtime-D-cZa8P0.mjs} +81 -35
  20. package/dist/.setup/crypto-state-store-B43k3z3W.mjs +352 -0
  21. package/dist/{deps-CcVJfvRM.js → .setup/deps-Dy6yreL4.mjs} +92 -25
  22. package/dist/{device-health-B4-YXtJR.js → .setup/device-health-D4LBxuPq.mjs} +1 -6
  23. package/dist/{directory-live-C8dVBiCc.js → .setup/directory-live-BTEYxMwy.mjs} +10 -9
  24. package/dist/.setup/doctor-BGnvMzOR.mjs +169 -0
  25. package/dist/.setup/doctor-contract-DNJw0fdq.mjs +246 -0
  26. package/dist/{draft-stream-CtvOXq0Z.js → .setup/draft-stream-C-_OhpE8.mjs} +1 -6
  27. package/dist/{encryption-guidance-CbEFe38F.js → .setup/encryption-guidance-CpuuwmjL.mjs} +4 -3
  28. package/dist/{env-auth-CQsYbz-p.js → .setup/env-auth-CYJL1jNl.mjs} +2 -2
  29. package/dist/{env-vars-B0NxQnPk.js → .setup/env-vars-KzaYveuy.mjs} +1 -3
  30. package/dist/{exec-approval-resolver-BCgqRtZS.js → .setup/exec-approval-resolver-f9j6staN.mjs} +1 -2
  31. package/dist/{file-sync-store-DiiFsayX.js → .setup/file-sync-store-DU0cnYAz.mjs} +30 -25
  32. package/dist/{http-client-CycYxU9-.js → .setup/http-client-C954In2D.mjs} +45 -25
  33. package/dist/{idb-persistence-B6x7dMsF.js → .setup/idb-persistence-_HKTXkVC.mjs} +76 -78
  34. package/dist/{idb-persistence-lock-DAJ49nZX.js → .setup/idb-persistence-lock-B3fZXyF_.mjs} +1 -1
  35. package/dist/.setup/legacy-crypto-inspector-Byp8LCys.mjs +42 -0
  36. package/dist/.setup/legacy-crypto-restore-YQVoK1B2.mjs +93 -0
  37. package/dist/{logger-D0GCSDQq.js → .setup/logger-DpoogOgz.mjs} +1 -1
  38. package/dist/{logging-DV-p52N0.js → .setup/logging-CgxQOJJP.mjs} +2 -9
  39. package/dist/.setup/matrix-migration.runtime-BDH5c3fN.mjs +530 -0
  40. package/dist/{media-text-BTwzADS_.js → .setup/media-text-Cib-dxkn.mjs} +1 -1
  41. package/dist/{messages-DxQJkhxs.js → .setup/messages-D4DYGHYX.mjs} +15 -67
  42. package/dist/.setup/migration-snapshot-backup-CpgYhiUp.mjs +70 -0
  43. package/dist/.setup/migration-snapshot.runtime-O8qkMVaC.mjs +2 -0
  44. package/dist/{monitor-VyWlSLwo.js → .setup/monitor-DNcW_oAN.mjs} +2525 -2361
  45. package/dist/.setup/probe.runtime-CMPh0mFk.mjs +2 -0
  46. package/dist/{profile-update-CffmyW_4.js → .setup/profile-update-DzOL3Wiw.mjs} +5 -4
  47. package/dist/{reaction-events-B00WSi98.js → .setup/reaction-events-BcvgXxHb.mjs} +14 -64
  48. package/dist/{resolve-targets-nm2L48sh.js → .setup/resolve-targets-Bq80X9Sn.mjs} +3 -3
  49. package/dist/{resolver.runtime-DS6uPaEe.js → .setup/resolver.runtime-CeBHR9-T.mjs} +1 -1
  50. package/dist/{runtime-api-D1xI_cvh.js → .setup/runtime-api-CEsWNdil.mjs} +4 -4
  51. package/dist/.setup/runtime-setter-api-DGMubGUq.mjs +3 -0
  52. package/dist/{sdk-bUytQHx7.js → .setup/sdk-He1quVAq.mjs} +592 -261
  53. package/dist/.setup/secret-contract-api-CiTJ7pd5.mjs +3 -0
  54. package/dist/{secret-contract-M3hRmGO-.js → .setup/secret-contract-phPvlNfV.mjs} +53 -28
  55. package/dist/{send-BldGYG8g.js → .setup/send-CGgl0uTn.mjs} +133 -660
  56. package/dist/{setup-bootstrap-Deleiibz.js → .setup/setup-bootstrap-DUXBC8X2.mjs} +4 -4
  57. package/dist/{setup-core-BVfBv2ai.js → .setup/setup-core-bhdcEo7v.mjs} +239 -189
  58. package/dist/.setup/setup-plugin-api-CAwZ_Bi7.mjs +43 -0
  59. package/dist/.setup/setup-plugin-api-DIFVsOs3.mjs +2 -0
  60. package/dist/{setup-surface-BBq3WeqX.js → .setup/setup-surface-05_G-MnT.mjs} +149 -92
  61. package/dist/{startup-verification-wm3_i88s.js → .setup/startup-verification-BTwIGu1J.mjs} +7 -6
  62. package/dist/.setup/storage-NGZq5zet.mjs +432 -0
  63. package/dist/{storage-paths-gUmSydsW.js → .setup/storage-paths-BWo_ZEMC.mjs} +13 -2
  64. package/dist/{subagent-hooks-dkPAF6Et.js → .setup/subagent-hooks-BSWPJEmo.mjs} +2 -2
  65. package/dist/{thread-binding-api-DRbBZlhS.js → .setup/thread-binding-api-B7UaOoKv.mjs} +1 -1
  66. package/dist/{thread-bindings-DGbl3vDW.js → .setup/thread-bindings-DqmjG2on.mjs} +8 -8
  67. package/dist/{tool-actions.runtime-uu9blSqO.js → .setup/tool-actions.runtime-CXDLk2jg.mjs} +196 -332
  68. package/dist/{verification-DYMQ1QpI.js → .setup/verification-DeWOtZJr.mjs} +4 -3
  69. package/dist/api.js +9 -9
  70. package/dist/auth-presence.js +21 -13
  71. package/dist/channel-plugin-api.js +1 -1
  72. package/dist/cli-metadata.js +1 -1
  73. package/dist/contract-api.js +2 -2
  74. package/dist/doctor-contract-api.js +99 -524
  75. package/dist/helper-api.js +4 -4
  76. package/dist/index.js +1 -1
  77. package/dist/plugin-entry.handlers.runtime.js +2 -2
  78. package/dist/runtime-api.js +8 -8
  79. package/dist/runtime-heavy-api.js +3 -0
  80. package/dist/runtime-setter-api.js +1 -1
  81. package/dist/secret-contract-api.js +1 -1
  82. package/dist/session-binding-contract-api.js +3 -3
  83. package/dist/setup-entry.js +4 -3
  84. package/dist/setup-plugin-api.js +1 -44
  85. package/dist/subagent-hooks-api.js +1 -1
  86. package/dist/thread-binding-api.js +1 -1
  87. package/dist/thread-bindings-runtime.js +1 -1
  88. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/package.json +1 -1
  89. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm.d.ts +2 -14
  90. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.cjs +384 -409
  91. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.js +224 -246
  92. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm +0 -0
  93. package/node_modules/@matrix-org/matrix-sdk-crypto-wasm/pkg/matrix_sdk_crypto_wasm_bg.wasm.d.ts +58 -59
  94. package/node_modules/markdown-it/README.md +18 -294
  95. package/node_modules/markdown-it/bin/markdown-it.mjs +2 -2
  96. package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs +3013 -0
  97. package/node_modules/markdown-it/dist/browser/markdown-it.esm.min.mjs.map +1 -0
  98. package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js +14 -0
  99. package/node_modules/markdown-it/dist/browser/markdown-it.umd.min.js.map +1 -0
  100. package/node_modules/markdown-it/dist/markdown-it.cjs.js +4420 -0
  101. package/node_modules/markdown-it/dist/markdown-it.cjs.js.map +1 -0
  102. package/node_modules/markdown-it/dist/markdown-it.d.cts +19 -0
  103. package/node_modules/markdown-it/dist/markdown-it.d.mts +950 -0
  104. package/node_modules/markdown-it/dist/{index.cjs.js → markdown-it.mjs} +1504 -1525
  105. package/node_modules/markdown-it/dist/markdown-it.mjs.map +1 -0
  106. package/node_modules/markdown-it/node_modules/argparse/LICENSE +1 -208
  107. package/node_modules/markdown-it/node_modules/argparse/README.md +46 -41
  108. package/node_modules/markdown-it/node_modules/argparse/lib/_colorize.js +72 -0
  109. package/node_modules/markdown-it/node_modules/argparse/lib/argparse.d.ts +292 -0
  110. package/node_modules/markdown-it/node_modules/argparse/{argparse.js → lib/argparse.js} +1142 -1029
  111. package/node_modules/markdown-it/node_modules/argparse/lib/difflib.js +190 -0
  112. package/node_modules/markdown-it/node_modules/argparse/lib/sub.js +4 -4
  113. package/node_modules/markdown-it/node_modules/argparse/lib/textwrap.js +28 -28
  114. package/node_modules/markdown-it/node_modules/argparse/package.json +18 -11
  115. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts +8 -0
  116. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.d.ts.map +1 -0
  117. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js +46 -0
  118. package/node_modules/markdown-it/node_modules/entities/dist/decode-codepoint.js.map +1 -0
  119. package/node_modules/markdown-it/node_modules/entities/{lib → dist}/decode.d.ts +28 -45
  120. package/node_modules/markdown-it/node_modules/entities/dist/decode.d.ts.map +1 -0
  121. package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/decode.js +189 -141
  122. package/node_modules/markdown-it/node_modules/entities/dist/decode.js.map +1 -0
  123. package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/encode.d.ts +4 -2
  124. package/node_modules/markdown-it/node_modules/entities/dist/encode.d.ts.map +1 -0
  125. package/node_modules/markdown-it/node_modules/entities/dist/encode.js +90 -0
  126. package/node_modules/markdown-it/node_modules/entities/dist/encode.js.map +1 -0
  127. package/node_modules/markdown-it/node_modules/entities/{lib → dist}/escape.d.ts +15 -10
  128. package/node_modules/markdown-it/node_modules/entities/dist/escape.d.ts.map +1 -0
  129. package/node_modules/markdown-it/node_modules/entities/dist/escape.js +132 -0
  130. package/node_modules/markdown-it/node_modules/entities/dist/escape.js.map +1 -0
  131. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts +3 -0
  132. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.d.ts.map +1 -0
  133. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js +5 -0
  134. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-html.js.map +1 -0
  135. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts +3 -0
  136. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.d.ts.map +1 -0
  137. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js +5 -0
  138. package/node_modules/markdown-it/node_modules/entities/dist/generated/decode-data-xml.js.map +1 -0
  139. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts +5 -0
  140. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.d.ts.map +1 -0
  141. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js +12 -0
  142. package/node_modules/markdown-it/node_modules/entities/dist/generated/encode-html.js.map +1 -0
  143. package/node_modules/markdown-it/node_modules/entities/{lib/esm → dist}/index.d.ts +14 -21
  144. package/node_modules/markdown-it/node_modules/entities/dist/index.d.ts.map +1 -0
  145. package/node_modules/markdown-it/node_modules/entities/dist/index.js +91 -0
  146. package/node_modules/markdown-it/node_modules/entities/dist/index.js.map +1 -0
  147. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts +17 -0
  148. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.d.ts.map +1 -0
  149. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js +18 -0
  150. package/node_modules/markdown-it/node_modules/entities/dist/internal/bin-trie-flags.js.map +1 -0
  151. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts +7 -0
  152. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.d.ts.map +1 -0
  153. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js +17 -0
  154. package/node_modules/markdown-it/node_modules/entities/dist/internal/decode-shared.js.map +1 -0
  155. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts +33 -0
  156. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.d.ts.map +1 -0
  157. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js +93 -0
  158. package/node_modules/markdown-it/node_modules/entities/dist/internal/encode-shared.js.map +1 -0
  159. package/node_modules/markdown-it/node_modules/entities/package.json +63 -70
  160. package/node_modules/markdown-it/node_modules/entities/readme.md +54 -45
  161. package/node_modules/markdown-it/node_modules/entities/src/decode-codepoint.ts +50 -0
  162. package/node_modules/markdown-it/node_modules/entities/src/decode.ts +671 -0
  163. package/node_modules/markdown-it/node_modules/entities/src/encode.ts +95 -0
  164. package/node_modules/markdown-it/node_modules/entities/src/escape.ts +160 -0
  165. package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-html.ts +7 -0
  166. package/node_modules/markdown-it/node_modules/entities/src/generated/decode-data-xml.ts +7 -0
  167. package/node_modules/markdown-it/node_modules/entities/src/generated/encode-html.ts +18 -0
  168. package/node_modules/markdown-it/node_modules/entities/src/index.ts +162 -0
  169. package/node_modules/markdown-it/node_modules/entities/src/internal/bin-trie-flags.ts +16 -0
  170. package/node_modules/markdown-it/node_modules/entities/src/internal/decode-shared.ts +18 -0
  171. package/node_modules/markdown-it/node_modules/entities/src/internal/encode-shared.ts +123 -0
  172. package/node_modules/markdown-it/node_modules/linkify-it/README.md +49 -86
  173. package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js +636 -825
  174. package/node_modules/markdown-it/node_modules/linkify-it/build/index.cjs.js.map +1 -0
  175. package/node_modules/markdown-it/node_modules/linkify-it/build/index.d.ts +236 -0
  176. package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs +538 -0
  177. package/node_modules/markdown-it/node_modules/linkify-it/build/index.mjs.map +1 -0
  178. package/node_modules/markdown-it/node_modules/linkify-it/package.json +23 -20
  179. package/node_modules/markdown-it/node_modules/uc.micro/README.md +18 -1
  180. package/node_modules/markdown-it/node_modules/uc.micro/build/index.cjs.js +13 -18
  181. package/node_modules/markdown-it/node_modules/uc.micro/build/index.d.ts +6 -0
  182. package/node_modules/markdown-it/node_modules/uc.micro/build/index.mjs +8 -0
  183. package/node_modules/markdown-it/node_modules/uc.micro/package.json +12 -17
  184. package/node_modules/markdown-it/package.json +47 -30
  185. package/node_modules/matrix-js-sdk/CHANGELOG.md +0 -11
  186. package/node_modules/matrix-js-sdk/package.json +1 -1
  187. package/node_modules/music-metadata/lib/common/Util.d.ts +1 -1
  188. package/node_modules/music-metadata/lib/common/Util.js +1 -7
  189. package/node_modules/music-metadata/lib/id3v2/FrameHeader.js +3 -23
  190. package/node_modules/music-metadata/lib/id3v2/FrameParser.js +2 -2
  191. package/node_modules/music-metadata/lib/id3v2/ID3v2Token.js +1 -1
  192. package/node_modules/music-metadata/lib/mp4/AtomToken.js +13 -38
  193. package/node_modules/music-metadata/lib/mpeg/MpegParser.js +1 -1
  194. package/node_modules/music-metadata/package.json +6 -6
  195. package/node_modules/typebox/build/compile/validator.d.mts +4 -1
  196. package/node_modules/typebox/build/guard/guard.d.mts +1 -1
  197. package/node_modules/typebox/build/guard/guard.mjs +2 -5
  198. package/node_modules/typebox/build/guard/string.mjs +4 -16
  199. package/node_modules/typebox/build/schema/engine/_functions.mjs +15 -34
  200. package/node_modules/typebox/build/type/action/readonly_object.d.mts +0 -5
  201. package/node_modules/typebox/build/type/action/readonly_object.mjs +0 -8
  202. package/node_modules/typebox/build/typebox.d.mts +1 -1
  203. package/node_modules/typebox/build/typebox.mjs +1 -1
  204. package/node_modules/typebox/package.json +1 -1
  205. package/node_modules/typebox/readme.md +32 -29
  206. package/openclaw.plugin.json +146 -152
  207. package/package.json +31 -114
  208. package/dist/accounts-DfngqebB.js +0 -130
  209. package/dist/active-client-DXvz2gCo.js +0 -20
  210. package/dist/approval-reactions-D-BxBK_L.js +0 -202
  211. package/dist/client-Dbso3-0V.js +0 -30
  212. package/dist/client-bootstrap-XsIkHNt0.js +0 -110
  213. package/dist/create-client-BmSU-q-D.js +0 -61
  214. package/dist/credentials-W2EmwRhu.js +0 -65
  215. package/dist/credentials-read-DVmFCm7X.js +0 -77
  216. package/dist/doctor-CM8ijNpW.js +0 -64
  217. package/dist/doctor-contract-BMSJkkAE.js +0 -167
  218. package/dist/inbound-dedupe-CaBLblef.js +0 -48
  219. package/dist/probe.runtime-BuieqmS3.js +0 -3
  220. package/dist/record-shared-CWWx6fvI.js +0 -2
  221. package/dist/recovery-key-store-BNnHvXdk.js +0 -275
  222. package/dist/room-info-CAFZ3Z9J.js +0 -87
  223. package/dist/route-DY6at4qJ.js +0 -161
  224. package/dist/storage-BvAkgzvT.js +0 -685
  225. package/node_modules/markdown-it/dist/index.cjs.js.map +0 -1
  226. package/node_modules/markdown-it/dist/markdown-it.js +0 -3975
  227. package/node_modules/markdown-it/dist/markdown-it.js.map +0 -1
  228. package/node_modules/markdown-it/dist/markdown-it.min.js +0 -3
  229. package/node_modules/markdown-it/dist/markdown-it.min.js.map +0 -1
  230. package/node_modules/markdown-it/index.mjs +0 -1
  231. package/node_modules/markdown-it/lib/common/html_blocks.mjs +0 -67
  232. package/node_modules/markdown-it/lib/common/html_re.mjs +0 -25
  233. package/node_modules/markdown-it/lib/common/utils.mjs +0 -324
  234. package/node_modules/markdown-it/lib/helpers/index.mjs +0 -11
  235. package/node_modules/markdown-it/lib/helpers/parse_link_destination.mjs +0 -77
  236. package/node_modules/markdown-it/lib/helpers/parse_link_label.mjs +0 -49
  237. package/node_modules/markdown-it/lib/helpers/parse_link_title.mjs +0 -66
  238. package/node_modules/markdown-it/lib/index.mjs +0 -565
  239. package/node_modules/markdown-it/lib/parser_block.mjs +0 -134
  240. package/node_modules/markdown-it/lib/parser_core.mjs +0 -62
  241. package/node_modules/markdown-it/lib/parser_inline.mjs +0 -197
  242. package/node_modules/markdown-it/lib/presets/commonmark.mjs +0 -88
  243. package/node_modules/markdown-it/lib/presets/default.mjs +0 -47
  244. package/node_modules/markdown-it/lib/presets/zero.mjs +0 -70
  245. package/node_modules/markdown-it/lib/renderer.mjs +0 -322
  246. package/node_modules/markdown-it/lib/ruler.mjs +0 -340
  247. package/node_modules/markdown-it/lib/rules_block/blockquote.mjs +0 -209
  248. package/node_modules/markdown-it/lib/rules_block/code.mjs +0 -30
  249. package/node_modules/markdown-it/lib/rules_block/fence.mjs +0 -94
  250. package/node_modules/markdown-it/lib/rules_block/heading.mjs +0 -51
  251. package/node_modules/markdown-it/lib/rules_block/hr.mjs +0 -40
  252. package/node_modules/markdown-it/lib/rules_block/html_block.mjs +0 -80
  253. package/node_modules/markdown-it/lib/rules_block/lheading.mjs +0 -85
  254. package/node_modules/markdown-it/lib/rules_block/list.mjs +0 -331
  255. package/node_modules/markdown-it/lib/rules_block/paragraph.mjs +0 -48
  256. package/node_modules/markdown-it/lib/rules_block/reference.mjs +0 -212
  257. package/node_modules/markdown-it/lib/rules_block/state_block.mjs +0 -220
  258. package/node_modules/markdown-it/lib/rules_block/table.mjs +0 -228
  259. package/node_modules/markdown-it/lib/rules_core/block.mjs +0 -13
  260. package/node_modules/markdown-it/lib/rules_core/inline.mjs +0 -11
  261. package/node_modules/markdown-it/lib/rules_core/linkify.mjs +0 -134
  262. package/node_modules/markdown-it/lib/rules_core/normalize.mjs +0 -17
  263. package/node_modules/markdown-it/lib/rules_core/replacements.mjs +0 -101
  264. package/node_modules/markdown-it/lib/rules_core/smartquotes.mjs +0 -209
  265. package/node_modules/markdown-it/lib/rules_core/state_core.mjs +0 -17
  266. package/node_modules/markdown-it/lib/rules_core/text_join.mjs +0 -43
  267. package/node_modules/markdown-it/lib/rules_inline/autolink.mjs +0 -72
  268. package/node_modules/markdown-it/lib/rules_inline/backticks.mjs +0 -60
  269. package/node_modules/markdown-it/lib/rules_inline/balance_pairs.mjs +0 -124
  270. package/node_modules/markdown-it/lib/rules_inline/emphasis.mjs +0 -123
  271. package/node_modules/markdown-it/lib/rules_inline/entity.mjs +0 -51
  272. package/node_modules/markdown-it/lib/rules_inline/escape.mjs +0 -83
  273. package/node_modules/markdown-it/lib/rules_inline/fragments_join.mjs +0 -38
  274. package/node_modules/markdown-it/lib/rules_inline/html_inline.mjs +0 -50
  275. package/node_modules/markdown-it/lib/rules_inline/image.mjs +0 -138
  276. package/node_modules/markdown-it/lib/rules_inline/link.mjs +0 -139
  277. package/node_modules/markdown-it/lib/rules_inline/linkify.mjs +0 -63
  278. package/node_modules/markdown-it/lib/rules_inline/newline.mjs +0 -42
  279. package/node_modules/markdown-it/lib/rules_inline/state_inline.mjs +0 -154
  280. package/node_modules/markdown-it/lib/rules_inline/strikethrough.mjs +0 -127
  281. package/node_modules/markdown-it/lib/rules_inline/text.mjs +0 -86
  282. package/node_modules/markdown-it/lib/token.mjs +0 -191
  283. package/node_modules/markdown-it/node_modules/argparse/CHANGELOG.md +0 -216
  284. package/node_modules/markdown-it/node_modules/entities/lib/decode.d.ts.map +0 -1
  285. package/node_modules/markdown-it/node_modules/entities/lib/decode.js +0 -536
  286. package/node_modules/markdown-it/node_modules/entities/lib/decode.js.map +0 -1
  287. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts +0 -19
  288. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.d.ts.map +0 -1
  289. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js +0 -76
  290. package/node_modules/markdown-it/node_modules/entities/lib/decode_codepoint.js.map +0 -1
  291. package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts +0 -22
  292. package/node_modules/markdown-it/node_modules/entities/lib/encode.d.ts.map +0 -1
  293. package/node_modules/markdown-it/node_modules/entities/lib/encode.js +0 -77
  294. package/node_modules/markdown-it/node_modules/entities/lib/encode.js.map +0 -1
  295. package/node_modules/markdown-it/node_modules/entities/lib/escape.d.ts.map +0 -1
  296. package/node_modules/markdown-it/node_modules/entities/lib/escape.js +0 -122
  297. package/node_modules/markdown-it/node_modules/entities/lib/escape.js.map +0 -1
  298. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts +0 -211
  299. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.d.ts.map +0 -1
  300. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode.js.map +0 -1
  301. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts +0 -19
  302. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.d.ts.map +0 -1
  303. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js +0 -71
  304. package/node_modules/markdown-it/node_modules/entities/lib/esm/decode_codepoint.js.map +0 -1
  305. package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.d.ts.map +0 -1
  306. package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js +0 -69
  307. package/node_modules/markdown-it/node_modules/entities/lib/esm/encode.js.map +0 -1
  308. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts +0 -43
  309. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.d.ts.map +0 -1
  310. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js +0 -116
  311. package/node_modules/markdown-it/node_modules/entities/lib/esm/escape.js.map +0 -1
  312. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts +0 -3
  313. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.d.ts.map +0 -1
  314. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js +0 -7
  315. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-html.js.map +0 -1
  316. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts +0 -3
  317. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.d.ts.map +0 -1
  318. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js +0 -7
  319. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/decode-data-xml.js.map +0 -1
  320. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts +0 -8
  321. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.d.ts.map +0 -1
  322. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js +0 -10
  323. package/node_modules/markdown-it/node_modules/entities/lib/esm/generated/encode-html.js.map +0 -1
  324. package/node_modules/markdown-it/node_modules/entities/lib/esm/index.d.ts.map +0 -1
  325. package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js +0 -99
  326. package/node_modules/markdown-it/node_modules/entities/lib/esm/index.js.map +0 -1
  327. package/node_modules/markdown-it/node_modules/entities/lib/esm/package.json +0 -1
  328. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts +0 -3
  329. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.d.ts.map +0 -1
  330. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js +0 -9
  331. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-html.js.map +0 -1
  332. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts +0 -3
  333. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.d.ts.map +0 -1
  334. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js +0 -9
  335. package/node_modules/markdown-it/node_modules/entities/lib/generated/decode-data-xml.js.map +0 -1
  336. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts +0 -8
  337. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.d.ts.map +0 -1
  338. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js +0 -12
  339. package/node_modules/markdown-it/node_modules/entities/lib/generated/encode-html.js.map +0 -1
  340. package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts +0 -96
  341. package/node_modules/markdown-it/node_modules/entities/lib/index.d.ts.map +0 -1
  342. package/node_modules/markdown-it/node_modules/entities/lib/index.js +0 -126
  343. package/node_modules/markdown-it/node_modules/entities/lib/index.js.map +0 -1
  344. package/node_modules/markdown-it/node_modules/linkify-it/index.mjs +0 -646
  345. package/node_modules/markdown-it/node_modules/linkify-it/lib/re.mjs +0 -193
  346. package/node_modules/markdown-it/node_modules/uc.micro/categories/Cc/regex.mjs +0 -1
  347. package/node_modules/markdown-it/node_modules/uc.micro/categories/Cf/regex.mjs +0 -1
  348. package/node_modules/markdown-it/node_modules/uc.micro/categories/P/regex.mjs +0 -1
  349. package/node_modules/markdown-it/node_modules/uc.micro/categories/S/regex.mjs +0 -1
  350. package/node_modules/markdown-it/node_modules/uc.micro/categories/Z/regex.mjs +0 -1
  351. package/node_modules/markdown-it/node_modules/uc.micro/index.mjs +0 -8
  352. package/node_modules/markdown-it/node_modules/uc.micro/properties/Any/regex.mjs +0 -1
  353. /package/dist/{account-config-BZWN9tGS.js → .setup/account-config-BZWN9tGS.mjs} +0 -0
  354. /package/dist/{backup-health-Dm_YMVFT.js → .setup/backup-health-Dm_YMVFT.mjs} +0 -0
  355. /package/dist/{config-paths-CnREYb1Y.js → .setup/config-paths-CnREYb1Y.mjs} +0 -0
  356. /package/dist/{config-secret-input.runtime-CwsP3--c.js → .setup/config-secret-input.runtime-CwsP3--c.mjs} +0 -0
  357. /package/dist/{crypto-node.runtime-6Aj_ltHQ.js → .setup/crypto-node.runtime-6Aj_ltHQ.mjs} +0 -0
  358. /package/dist/{errors-C47hvAF8.js → .setup/errors-C47hvAF8.mjs} +0 -0
  359. /package/dist/{preflight-audio.runtime-BZxxQsxY.js → .setup/preflight-audio.runtime-BZxxQsxY.mjs} +0 -0
  360. /package/dist/{reaction-common-DkrQdBSZ.js → .setup/reaction-common-DkrQdBSZ.mjs} +0 -0
  361. /package/dist/{rolldown-runtime-8H4AJuhK.js → .setup/rolldown-runtime-8H4AJuhK.mjs} +0 -0
  362. /package/dist/{runtime-6S3DNFNv.js → .setup/runtime-6S3DNFNv.mjs} +0 -0
  363. /package/dist/{runtime-BefyhPWv.js → .setup/runtime-BefyhPWv.mjs} +0 -0
  364. /package/dist/{sync-state-CWbp0QSY.js → .setup/sync-state-CWbp0QSY.mjs} +0 -0
  365. /package/dist/{target-ids-B-5aQxwn.js → .setup/target-ids-B-5aQxwn.mjs} +0 -0
  366. /package/dist/{thread-bindings-shared-CKnY4LSd.js → .setup/thread-bindings-shared-CKnY4LSd.mjs} +0 -0
  367. /package/dist/{timeout-abort-signal-DMrgRFIy.js → .setup/timeout-abort-signal-DMrgRFIy.mjs} +0 -0
  368. /package/dist/{url-validation-GRHde6lq.js → .setup/url-validation-GRHde6lq.mjs} +0 -0
@@ -0,0 +1,4420 @@
1
+ /*! markdown-it 15.0.2 https://github.com/markdown-it/markdown-it @license MIT */
2
+ //#region \0rolldown/runtime.js
3
+ var __create = Object.create;
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
+ var __getOwnPropNames = Object.getOwnPropertyNames;
7
+ var __getProtoOf = Object.getPrototypeOf;
8
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ var __exportAll = (all, no_symbols) => {
10
+ let target = {};
11
+ for (var name in all) __defProp(target, name, {
12
+ get: all[name],
13
+ enumerable: true
14
+ });
15
+ if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
16
+ return target;
17
+ };
18
+ var __copyProps = (to, from, except, desc) => {
19
+ if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
20
+ key = keys[i];
21
+ if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
22
+ get: ((k) => from[k]).bind(null, key),
23
+ enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
24
+ });
25
+ }
26
+ return to;
27
+ };
28
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule || !__hasOwnProp.call(mod, "default") ? __defProp(target, "default", {
29
+ value: mod,
30
+ enumerable: true
31
+ }) : target, mod));
32
+ //#endregion
33
+ let mdurl = require("mdurl");
34
+ mdurl = __toESM(mdurl, 1);
35
+ let uc_micro = require("uc.micro");
36
+ uc_micro = __toESM(uc_micro, 1);
37
+ let linkify_it = require("linkify-it");
38
+ let punycode_js = require("punycode.js");
39
+ punycode_js = __toESM(punycode_js, 1);
40
+ //#region node_modules/entities/dist/decode-codepoint.js
41
+ var decodeMap = /* @__PURE__ */ new Map([
42
+ [0, 65533],
43
+ [128, 8364],
44
+ [130, 8218],
45
+ [131, 402],
46
+ [132, 8222],
47
+ [133, 8230],
48
+ [134, 8224],
49
+ [135, 8225],
50
+ [136, 710],
51
+ [137, 8240],
52
+ [138, 352],
53
+ [139, 8249],
54
+ [140, 338],
55
+ [142, 381],
56
+ [145, 8216],
57
+ [146, 8217],
58
+ [147, 8220],
59
+ [148, 8221],
60
+ [149, 8226],
61
+ [150, 8211],
62
+ [151, 8212],
63
+ [152, 732],
64
+ [153, 8482],
65
+ [154, 353],
66
+ [155, 8250],
67
+ [156, 339],
68
+ [158, 382],
69
+ [159, 376]
70
+ ]);
71
+ /**
72
+ * Replace the given code point with a replacement character if it is a
73
+ * surrogate or is outside the valid range. Otherwise return the code
74
+ * point unchanged.
75
+ * @param codePoint Unicode code point to convert.
76
+ */
77
+ function replaceCodePoint(codePoint) {
78
+ var _decodeMap$get;
79
+ if (codePoint >= 55296 && codePoint <= 57343 || codePoint > 1114111) return 65533;
80
+ return (_decodeMap$get = decodeMap.get(codePoint)) !== null && _decodeMap$get !== void 0 ? _decodeMap$get : codePoint;
81
+ }
82
+ //#endregion
83
+ //#region node_modules/entities/dist/internal/decode-shared.js
84
+ /**
85
+ * Shared base64 decode helper for generated decode data.
86
+ * Assumes global atob is available.
87
+ * @param input Input string to encode or decode.
88
+ */
89
+ function decodeBase64(input) {
90
+ const binary = atob(input);
91
+ const evenLength = binary.length & -2;
92
+ const out = new Uint16Array(evenLength / 2);
93
+ for (let index = 0, outIndex = 0; index < evenLength; index += 2) {
94
+ const lo = binary.charCodeAt(index);
95
+ const hi = binary.charCodeAt(index + 1);
96
+ out[outIndex++] = lo | hi << 8;
97
+ }
98
+ return out;
99
+ }
100
+ //#endregion
101
+ //#region node_modules/entities/dist/generated/decode-data-html.js
102
+ /** Packed HTML decode trie data. */
103
+ var htmlDecodeTree = /* #__PURE__ */ decodeBase64("QR08ALkAAgH6AYsDNQR2BO0EPgXZBQEGLAbdBxMISQrvCmQLfQurDKQNLw4fD4YPpA+6D/IPAAAAAAAAAAAAAAAAKhBMEY8TmxUWF2EYLBkxGuAa3RsJHDscWR8YIC8jSCSIJcMl6ie3Ku8rEC0CLjoupS7kLgAIRU1hYmNm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AFQuAABYLmIuAAAAAGMubS5wLnQuAAAAAIguki4AAJouJxIqEnQAcgDpAB0ScgAA4DXYNd0AAUFhWy5eLnIA8gDnAnIA8gCTB75jAAFBYWYuaS5yAPIA4AJyAPIAjAdhAPAAeh5pAHMAAKD7IoABZHB0APgReS6DLgABZmx9LoAuAOA12GnddQDzAP8RaQBtAOUABBIAAUFhiy6OLnIA8gDuAnIA8gCaBwABY3GVLgoScgAA4DXYzdwAAXB0nS6hLmwAdQDzACUScgDpACASAARhY2VmaW9zdbEuvC7ELsguzC7PLtQu2S5jAAABdXm2LrsudABlADuA/QD9QE9kAAFpecAuwy5yAGMAd2FLZG4AO4ClAKVAcgAA4DXYNt1jAHkAV2RwAGYAAOA12GrdYwByAADgNdjO3AABY23dLt8ueQBOZGwAO4D/AP9AAAVhY2RlZmhpb3N38y73Lv8uAi8MLxAvEy8YLx0vIi9jInV0ZQB6YQABYXn7Lv4u8iFvbn5hN2RvAHQAfGEAAWV0Bi8KL3QAcgDmAB8QYQC2Y3IAAOA12DfdYwB5ADZk5yJyYXJyAKDdIXAAZgAA4DXYa91jAHIAAOA12M/cAAFqbiYvKC8AoA0gagAAoAwg");
104
+ //#endregion
105
+ //#region node_modules/entities/dist/internal/bin-trie-flags.js
106
+ /**
107
+ * Bit flags & masks for the binary trie encoding used for entity decoding.
108
+ *
109
+ * Bit layout (16 bits total):
110
+ * 15..14 VALUE_LENGTH (+1 encoding; 0 => no value)
111
+ * 13 FLAG13. If valueLength>0: semicolon required flag (implicit ';').
112
+ * If valueLength==0: compact run flag.
113
+ * 12..7 BRANCH_LENGTH Branch length (0 => single branch in 6..0 if jumpOffset==char) OR run length (when compact run)
114
+ * 6..0 JUMP_TABLE Jump offset (jump table) OR single-branch char code OR first run char
115
+ */
116
+ var BinTrieFlags;
117
+ (function(BinTrieFlags) {
118
+ BinTrieFlags[BinTrieFlags["VALUE_LENGTH"] = 49152] = "VALUE_LENGTH";
119
+ BinTrieFlags[BinTrieFlags["FLAG13"] = 8192] = "FLAG13";
120
+ BinTrieFlags[BinTrieFlags["BRANCH_LENGTH"] = 8064] = "BRANCH_LENGTH";
121
+ BinTrieFlags[BinTrieFlags["JUMP_TABLE"] = 127] = "JUMP_TABLE";
122
+ })(BinTrieFlags || (BinTrieFlags = {}));
123
+ //#endregion
124
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/typeof.js
125
+ function _typeof(o) {
126
+ "@babel/helpers - typeof";
127
+ return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o) {
128
+ return typeof o;
129
+ } : function(o) {
130
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
131
+ }, _typeof(o);
132
+ }
133
+ //#endregion
134
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPrimitive.js
135
+ function toPrimitive(t, r) {
136
+ if ("object" != _typeof(t) || !t) return t;
137
+ var e = t[Symbol.toPrimitive];
138
+ if (void 0 !== e) {
139
+ var i = e.call(t, r || "default");
140
+ if ("object" != _typeof(i)) return i;
141
+ throw new TypeError("@@toPrimitive must return a primitive value.");
142
+ }
143
+ return ("string" === r ? String : Number)(t);
144
+ }
145
+ //#endregion
146
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/toPropertyKey.js
147
+ function toPropertyKey(t) {
148
+ var i = toPrimitive(t, "string");
149
+ return "symbol" == _typeof(i) ? i : i + "";
150
+ }
151
+ //#endregion
152
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/defineProperty.js
153
+ function _defineProperty(e, r, t) {
154
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
155
+ value: t,
156
+ enumerable: !0,
157
+ configurable: !0,
158
+ writable: !0
159
+ }) : e[r] = t, e;
160
+ }
161
+ //#endregion
162
+ //#region node_modules/entities/dist/decode.js
163
+ var CharCodes;
164
+ (function(CharCodes) {
165
+ CharCodes[CharCodes["NUM"] = 35] = "NUM";
166
+ CharCodes[CharCodes["SEMI"] = 59] = "SEMI";
167
+ CharCodes[CharCodes["EQUALS"] = 61] = "EQUALS";
168
+ CharCodes[CharCodes["ZERO"] = 48] = "ZERO";
169
+ CharCodes[CharCodes["NINE"] = 57] = "NINE";
170
+ CharCodes[CharCodes["LOWER_A"] = 97] = "LOWER_A";
171
+ CharCodes[CharCodes["LOWER_F"] = 102] = "LOWER_F";
172
+ CharCodes[CharCodes["LOWER_X"] = 120] = "LOWER_X";
173
+ CharCodes[CharCodes["LOWER_Z"] = 122] = "LOWER_Z";
174
+ CharCodes[CharCodes["UPPER_A"] = 65] = "UPPER_A";
175
+ CharCodes[CharCodes["UPPER_F"] = 70] = "UPPER_F";
176
+ CharCodes[CharCodes["UPPER_Z"] = 90] = "UPPER_Z";
177
+ })(CharCodes || (CharCodes = {}));
178
+ /** Bit that needs to be set to convert an upper case ASCII character to lower case */
179
+ var TO_LOWER_BIT = 32;
180
+ function isNumber(code) {
181
+ return code >= CharCodes.ZERO && code <= CharCodes.NINE;
182
+ }
183
+ function isHexadecimalCharacter(code) {
184
+ return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_F || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_F;
185
+ }
186
+ function isAsciiAlphaNumeric(code) {
187
+ return code >= CharCodes.UPPER_A && code <= CharCodes.UPPER_Z || code >= CharCodes.LOWER_A && code <= CharCodes.LOWER_Z || isNumber(code);
188
+ }
189
+ /**
190
+ * Checks if the given character is a valid end character for an entity in an attribute.
191
+ *
192
+ * Attribute values that aren't terminated properly aren't parsed, and shouldn't lead to a parser error.
193
+ * See the example in https://html.spec.whatwg.org/multipage/parsing.html#named-character-reference-state
194
+ * @param code Code point to decode.
195
+ */
196
+ function isEntityInAttributeInvalidEnd(code) {
197
+ return code === CharCodes.EQUALS || isAsciiAlphaNumeric(code);
198
+ }
199
+ var EntityDecoderState;
200
+ (function(EntityDecoderState) {
201
+ EntityDecoderState[EntityDecoderState["EntityStart"] = 0] = "EntityStart";
202
+ EntityDecoderState[EntityDecoderState["NumericStart"] = 1] = "NumericStart";
203
+ EntityDecoderState[EntityDecoderState["NumericDecimal"] = 2] = "NumericDecimal";
204
+ EntityDecoderState[EntityDecoderState["NumericHex"] = 3] = "NumericHex";
205
+ EntityDecoderState[EntityDecoderState["NamedEntity"] = 4] = "NamedEntity";
206
+ })(EntityDecoderState || (EntityDecoderState = {}));
207
+ /**
208
+ * Decoding mode for named entities.
209
+ */
210
+ var DecodingMode;
211
+ (function(DecodingMode) {
212
+ /** Entities in text nodes that can end with any character. */
213
+ DecodingMode[DecodingMode["Legacy"] = 0] = "Legacy";
214
+ /** Only allow entities terminated with a semicolon. */
215
+ DecodingMode[DecodingMode["Strict"] = 1] = "Strict";
216
+ /** Entities in attributes have limitations on ending characters. */
217
+ DecodingMode[DecodingMode["Attribute"] = 2] = "Attribute";
218
+ })(DecodingMode || (DecodingMode = {}));
219
+ /**
220
+ * Token decoder with support of writing partial entities.
221
+ */
222
+ var EntityDecoder = class {
223
+ constructor(decodeTree, emitCodePoint, errors) {
224
+ _defineProperty(this, "decodeTree", void 0);
225
+ _defineProperty(this, "emitCodePoint", void 0);
226
+ _defineProperty(this, "errors", void 0);
227
+ _defineProperty(
228
+ this,
229
+ /** The current state of the decoder. */
230
+ "state",
231
+ EntityDecoderState.EntityStart
232
+ );
233
+ _defineProperty(
234
+ this,
235
+ /** Characters that were consumed while parsing an entity. */
236
+ "consumed",
237
+ 1
238
+ );
239
+ _defineProperty(
240
+ this,
241
+ /**
242
+ * The result of the entity.
243
+ *
244
+ * Either the result index of a numeric entity, or the codepoint of a
245
+ * numeric entity.
246
+ */
247
+ "result",
248
+ 0
249
+ );
250
+ _defineProperty(
251
+ this,
252
+ /** The current index in the decode tree. */
253
+ "treeIndex",
254
+ 0
255
+ );
256
+ _defineProperty(
257
+ this,
258
+ /** The number of characters that were consumed in excess. */
259
+ "excess",
260
+ 1
261
+ );
262
+ _defineProperty(
263
+ this,
264
+ /** The mode in which the decoder is operating. */
265
+ "decodeMode",
266
+ DecodingMode.Strict
267
+ );
268
+ _defineProperty(
269
+ this,
270
+ /** The number of characters that have been consumed in the current run. */
271
+ "runConsumed",
272
+ 0
273
+ );
274
+ this.decodeTree = decodeTree;
275
+ this.emitCodePoint = emitCodePoint;
276
+ this.errors = errors;
277
+ }
278
+ /**
279
+ * Resets the instance to make it reusable.
280
+ * @param decodeMode Entity decoding mode to use.
281
+ */
282
+ startEntity(decodeMode) {
283
+ this.decodeMode = decodeMode;
284
+ this.state = EntityDecoderState.EntityStart;
285
+ this.result = 0;
286
+ this.treeIndex = 0;
287
+ this.excess = 1;
288
+ this.consumed = 1;
289
+ this.runConsumed = 0;
290
+ }
291
+ /**
292
+ * Write an entity to the decoder. This can be called multiple times with partial entities.
293
+ * If the entity is incomplete, the decoder will return -1.
294
+ *
295
+ * Mirrors the implementation of `getDecoder`, but with the ability to stop decoding if the
296
+ * entity is incomplete, and resume when the next string is written.
297
+ * @param input The string containing the entity (or a continuation of the entity).
298
+ * @param offset The offset at which the entity begins. Should be 0 if this is not the first call.
299
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
300
+ */
301
+ write(input, offset) {
302
+ switch (this.state) {
303
+ case EntityDecoderState.EntityStart:
304
+ if (input.charCodeAt(offset) === CharCodes.NUM) {
305
+ this.state = EntityDecoderState.NumericStart;
306
+ this.consumed += 1;
307
+ return this.stateNumericStart(input, offset + 1);
308
+ }
309
+ this.state = EntityDecoderState.NamedEntity;
310
+ return this.stateNamedEntity(input, offset);
311
+ case EntityDecoderState.NumericStart: return this.stateNumericStart(input, offset);
312
+ case EntityDecoderState.NumericDecimal: return this.stateNumericDecimal(input, offset);
313
+ case EntityDecoderState.NumericHex: return this.stateNumericHex(input, offset);
314
+ case EntityDecoderState.NamedEntity: return this.stateNamedEntity(input, offset);
315
+ }
316
+ }
317
+ /**
318
+ * Switches between the numeric decimal and hexadecimal states.
319
+ *
320
+ * Equivalent to the `Numeric character reference state` in the HTML spec.
321
+ * @param input The string containing the entity (or a continuation of the entity).
322
+ * @param offset The current offset.
323
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
324
+ */
325
+ stateNumericStart(input, offset) {
326
+ if (offset >= input.length) return -1;
327
+ if ((input.charCodeAt(offset) | TO_LOWER_BIT) === CharCodes.LOWER_X) {
328
+ this.state = EntityDecoderState.NumericHex;
329
+ this.consumed += 1;
330
+ return this.stateNumericHex(input, offset + 1);
331
+ }
332
+ this.state = EntityDecoderState.NumericDecimal;
333
+ return this.stateNumericDecimal(input, offset);
334
+ }
335
+ /**
336
+ * Parses a hexadecimal numeric entity.
337
+ *
338
+ * Equivalent to the `Hexademical character reference state` in the HTML spec.
339
+ * @param input The string containing the entity (or a continuation of the entity).
340
+ * @param offset The current offset.
341
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
342
+ */
343
+ stateNumericHex(input, offset) {
344
+ while (offset < input.length) {
345
+ const char = input.charCodeAt(offset);
346
+ if (isNumber(char) || isHexadecimalCharacter(char)) {
347
+ const digit = char <= CharCodes.NINE ? char - CharCodes.ZERO : (char | TO_LOWER_BIT) - CharCodes.LOWER_A + 10;
348
+ this.result = this.result * 16 + digit;
349
+ this.consumed++;
350
+ offset++;
351
+ } else return this.emitNumericEntity(char, 3);
352
+ }
353
+ return -1;
354
+ }
355
+ /**
356
+ * Parses a decimal numeric entity.
357
+ *
358
+ * Equivalent to the `Decimal character reference state` in the HTML spec.
359
+ * @param input The string containing the entity (or a continuation of the entity).
360
+ * @param offset The current offset.
361
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
362
+ */
363
+ stateNumericDecimal(input, offset) {
364
+ while (offset < input.length) {
365
+ const char = input.charCodeAt(offset);
366
+ if (isNumber(char)) {
367
+ this.result = this.result * 10 + (char - CharCodes.ZERO);
368
+ this.consumed++;
369
+ offset++;
370
+ } else return this.emitNumericEntity(char, 2);
371
+ }
372
+ return -1;
373
+ }
374
+ /**
375
+ * Validate and emit a numeric entity.
376
+ *
377
+ * Implements the logic from the `Hexademical character reference start
378
+ * state` and `Numeric character reference end state` in the HTML spec.
379
+ * @param lastCp The last code point of the entity. Used to see if the
380
+ * entity was terminated with a semicolon.
381
+ * @param expectedLength The minimum number of characters that should be
382
+ * consumed. Used to validate that at least one digit
383
+ * was consumed.
384
+ * @returns The number of characters that were consumed.
385
+ */
386
+ emitNumericEntity(lastCp, expectedLength) {
387
+ if (this.consumed <= expectedLength) {
388
+ var _this$errors;
389
+ (_this$errors = this.errors) === null || _this$errors === void 0 || _this$errors.absenceOfDigitsInNumericCharacterReference(this.consumed);
390
+ return 0;
391
+ }
392
+ if (lastCp === CharCodes.SEMI) this.consumed += 1;
393
+ else if (this.decodeMode === DecodingMode.Strict) return 0;
394
+ this.emitCodePoint(replaceCodePoint(this.result), this.consumed);
395
+ if (this.errors) {
396
+ if (lastCp !== CharCodes.SEMI) this.errors.missingSemicolonAfterCharacterReference();
397
+ this.errors.validateNumericCharacterReference(this.result);
398
+ }
399
+ return this.consumed;
400
+ }
401
+ /**
402
+ * Parses a named entity.
403
+ *
404
+ * Equivalent to the `Named character reference state` in the HTML spec.
405
+ * @param input The string containing the entity (or a continuation of the entity).
406
+ * @param offset The current offset.
407
+ * @returns The number of characters that were consumed, or -1 if the entity is incomplete.
408
+ */
409
+ stateNamedEntity(input, offset) {
410
+ const { decodeTree } = this;
411
+ let current = decodeTree[this.treeIndex];
412
+ let valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
413
+ while (offset < input.length) {
414
+ if (valueLength === 0 && (current & BinTrieFlags.FLAG13) !== 0) {
415
+ const runLength = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
416
+ if (this.runConsumed === 0) {
417
+ const firstChar = current & BinTrieFlags.JUMP_TABLE;
418
+ if (input.charCodeAt(offset) !== firstChar) return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
419
+ offset++;
420
+ this.excess++;
421
+ this.runConsumed++;
422
+ }
423
+ while (this.runConsumed < runLength) {
424
+ if (offset >= input.length) return -1;
425
+ const charIndexInPacked = this.runConsumed - 1;
426
+ const packedWord = decodeTree[this.treeIndex + 1 + (charIndexInPacked >> 1)];
427
+ const expectedChar = charIndexInPacked % 2 === 0 ? packedWord & 255 : packedWord >> 8 & 255;
428
+ if (input.charCodeAt(offset) !== expectedChar) {
429
+ this.runConsumed = 0;
430
+ return this.result === 0 ? 0 : this.emitNotTerminatedNamedEntity();
431
+ }
432
+ offset++;
433
+ this.excess++;
434
+ this.runConsumed++;
435
+ }
436
+ this.runConsumed = 0;
437
+ this.treeIndex += 1 + (runLength >> 1);
438
+ current = decodeTree[this.treeIndex];
439
+ valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
440
+ }
441
+ if (offset >= input.length) break;
442
+ const char = input.charCodeAt(offset);
443
+ if (char === CharCodes.SEMI && valueLength !== 0 && (current & BinTrieFlags.FLAG13) !== 0) return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
444
+ this.treeIndex = determineBranch(decodeTree, current, this.treeIndex + Math.max(1, valueLength), char);
445
+ if (this.treeIndex < 0) return this.result === 0 || this.decodeMode === DecodingMode.Attribute && (valueLength === 0 || isEntityInAttributeInvalidEnd(char)) ? 0 : this.emitNotTerminatedNamedEntity();
446
+ current = decodeTree[this.treeIndex];
447
+ valueLength = (current & BinTrieFlags.VALUE_LENGTH) >> 14;
448
+ if (valueLength !== 0) {
449
+ if (char === CharCodes.SEMI) return this.emitNamedEntityData(this.treeIndex, valueLength, this.consumed + this.excess);
450
+ if (this.decodeMode !== DecodingMode.Strict && (current & BinTrieFlags.FLAG13) === 0) {
451
+ this.result = this.treeIndex;
452
+ this.consumed += this.excess;
453
+ this.excess = 0;
454
+ }
455
+ }
456
+ offset++;
457
+ this.excess++;
458
+ }
459
+ return -1;
460
+ }
461
+ /**
462
+ * Emit a named entity that was not terminated with a semicolon.
463
+ * @returns The number of characters consumed.
464
+ */
465
+ emitNotTerminatedNamedEntity() {
466
+ var _this$errors2;
467
+ const { result, decodeTree } = this;
468
+ const valueLength = (decodeTree[result] & BinTrieFlags.VALUE_LENGTH) >> 14;
469
+ this.emitNamedEntityData(result, valueLength, this.consumed);
470
+ (_this$errors2 = this.errors) === null || _this$errors2 === void 0 || _this$errors2.missingSemicolonAfterCharacterReference();
471
+ return this.consumed;
472
+ }
473
+ /**
474
+ * Emit a named entity.
475
+ * @param result The index of the entity in the decode tree.
476
+ * @param valueLength The number of bytes in the entity.
477
+ * @param consumed The number of characters consumed.
478
+ * @returns The number of characters consumed.
479
+ */
480
+ emitNamedEntityData(result, valueLength, consumed) {
481
+ const { decodeTree } = this;
482
+ this.emitCodePoint(valueLength === 1 ? decodeTree[result] & ~(BinTrieFlags.VALUE_LENGTH | BinTrieFlags.FLAG13) : decodeTree[result + 1], consumed);
483
+ if (valueLength === 3) this.emitCodePoint(decodeTree[result + 2], consumed);
484
+ return consumed;
485
+ }
486
+ /**
487
+ * Signal to the parser that the end of the input was reached.
488
+ *
489
+ * Remaining data will be emitted and relevant errors will be produced.
490
+ * @returns The number of characters consumed.
491
+ */
492
+ end() {
493
+ switch (this.state) {
494
+ case EntityDecoderState.NamedEntity: return this.result !== 0 && (this.decodeMode !== DecodingMode.Attribute || this.result === this.treeIndex) ? this.emitNotTerminatedNamedEntity() : 0;
495
+ case EntityDecoderState.NumericDecimal: return this.emitNumericEntity(0, 2);
496
+ case EntityDecoderState.NumericHex: return this.emitNumericEntity(0, 3);
497
+ case EntityDecoderState.NumericStart:
498
+ var _this$errors3;
499
+ (_this$errors3 = this.errors) === null || _this$errors3 === void 0 || _this$errors3.absenceOfDigitsInNumericCharacterReference(this.consumed);
500
+ return 0;
501
+ case EntityDecoderState.EntityStart: return 0;
502
+ }
503
+ }
504
+ };
505
+ /**
506
+ * Creates a function that decodes entities in a string.
507
+ * @param decodeTree The decode tree.
508
+ * @returns A function that decodes entities in a string.
509
+ */
510
+ function getDecoder(decodeTree) {
511
+ let returnValue = "";
512
+ const decoder = new EntityDecoder(decodeTree, (data) => returnValue += String.fromCodePoint(data));
513
+ return function decodeWithTrie(input, decodeMode) {
514
+ let lastIndex = 0;
515
+ let offset = 0;
516
+ while ((offset = input.indexOf("&", offset)) >= 0) {
517
+ returnValue += input.slice(lastIndex, offset);
518
+ decoder.startEntity(decodeMode);
519
+ const length = decoder.write(input, offset + 1);
520
+ if (length < 0) {
521
+ lastIndex = offset + decoder.end();
522
+ break;
523
+ }
524
+ lastIndex = offset + length;
525
+ offset = length === 0 ? lastIndex + 1 : lastIndex;
526
+ }
527
+ const result = returnValue + input.slice(lastIndex);
528
+ returnValue = "";
529
+ return result;
530
+ };
531
+ }
532
+ /**
533
+ * Determines the branch of the current node that is taken given the current
534
+ * character. This function is used to traverse the trie.
535
+ * @param decodeTree The trie.
536
+ * @param current The current node.
537
+ * @param nodeIndex Index immediately after the current node header.
538
+ * @param char The current character.
539
+ * @returns The index of the next node, or -1 if no branch is taken.
540
+ */
541
+ function determineBranch(decodeTree, current, nodeIndex, char) {
542
+ const branchCount = (current & BinTrieFlags.BRANCH_LENGTH) >> 7;
543
+ const jumpOffset = current & BinTrieFlags.JUMP_TABLE;
544
+ if (branchCount === 0) return jumpOffset !== 0 && char === jumpOffset ? nodeIndex : -1;
545
+ if (jumpOffset) {
546
+ const value = char - jumpOffset;
547
+ return value < 0 || value >= branchCount ? -1 : decodeTree[nodeIndex + value] - 1;
548
+ }
549
+ const packedKeySlots = branchCount + 1 >> 1;
550
+ let lo = 0;
551
+ let hi = branchCount - 1;
552
+ while (lo <= hi) {
553
+ const mid = lo + hi >>> 1;
554
+ const midKey = decodeTree[nodeIndex + (mid >> 1)] >> (mid & 1) * 8 & 255;
555
+ if (midKey < char) lo = mid + 1;
556
+ else if (midKey > char) hi = mid - 1;
557
+ else return decodeTree[nodeIndex + packedKeySlots + mid];
558
+ }
559
+ return -1;
560
+ }
561
+ var htmlDecoder = /* #__PURE__ */ getDecoder(htmlDecodeTree);
562
+ /**
563
+ * Decodes an HTML string, requiring all entities to be terminated by a semicolon.
564
+ * @param htmlString The string to decode.
565
+ * @returns The decoded string.
566
+ */
567
+ function decodeHTMLStrict(htmlString) {
568
+ return htmlDecoder(htmlString, DecodingMode.Strict);
569
+ }
570
+ //#endregion
571
+ //#region src/common/utils.ts
572
+ /**
573
+ * Common utility functions exposed through `md.utils` for use by plugins.
574
+ *
575
+ * @module md.utils
576
+ */
577
+ var utils_exports = /* @__PURE__ */ __exportAll({
578
+ arrayReplaceAt: () => arrayReplaceAt,
579
+ asciiTrim: () => asciiTrim,
580
+ callable: () => callable,
581
+ escapeHtml: () => escapeHtml,
582
+ escapeRE: () => escapeRE,
583
+ fromCodePoint: () => fromCodePoint,
584
+ isMdAsciiPunct: () => isMdAsciiPunct,
585
+ isPunctChar: () => isPunctChar,
586
+ isPunctCharCode: () => isPunctCharCode,
587
+ isSpace: () => isSpace,
588
+ isValidEntityCode: () => isValidEntityCode,
589
+ isWhiteSpace: () => isWhiteSpace,
590
+ lib: () => lib,
591
+ normalizeReference: () => normalizeReference,
592
+ unescapeAll: () => unescapeAll,
593
+ unescapeMd: () => unescapeMd
594
+ });
595
+ function callable(cls) {
596
+ const wrapper = function(...args) {
597
+ return Reflect.construct(cls, args, new.target && new.target !== wrapper ? new.target : cls);
598
+ };
599
+ Object.defineProperty(wrapper, "name", { value: cls.name });
600
+ Object.setPrototypeOf(wrapper, cls);
601
+ wrapper.prototype = cls.prototype;
602
+ return wrapper;
603
+ }
604
+ /**
605
+ * Returns a copy of a token array with the token at `pos` replaced by
606
+ * `newElements`. Used to transform token streams without modifying the
607
+ * original array.
608
+ */
609
+ function arrayReplaceAt(src, pos, newElements) {
610
+ return [].concat(src.slice(0, pos), newElements, src.slice(pos + 1));
611
+ }
612
+ /** Checks whether a code point can be decoded from a numeric HTML entity. */
613
+ function isValidEntityCode(c) {
614
+ if (c >= 55296 && c <= 57343) return false;
615
+ if (c >= 64976 && c <= 65007) return false;
616
+ if ((c & 65535) === 65535 || (c & 65535) === 65534) return false;
617
+ if (c >= 0 && c <= 8) return false;
618
+ if (c === 11) return false;
619
+ if (c >= 14 && c <= 31) return false;
620
+ if (c >= 127 && c <= 159) return false;
621
+ if (c > 1114111) return false;
622
+ return true;
623
+ }
624
+ /**
625
+ * Converts a Unicode code point to a string, like `String.fromCodePoint()`,
626
+ * but does not throw for invalid input.
627
+ */
628
+ function fromCodePoint(c) {
629
+ if (c > 65535) {
630
+ c -= 65536;
631
+ const surrogate1 = 55296 + (c >> 10);
632
+ const surrogate2 = 56320 + (c & 1023);
633
+ return String.fromCharCode(surrogate1, surrogate2);
634
+ }
635
+ return String.fromCharCode(c);
636
+ }
637
+ var UNESCAPE_MD_RE = /\\([!"#$%&'()*+,\-./:;<=>?@[\\\]^_`{|}~])/g;
638
+ var UNESCAPE_ALL_RE = new RegExp(`${UNESCAPE_MD_RE.source}|${/&([a-z#][a-z0-9]{1,31});/gi.source}`, "gi");
639
+ var DIGITAL_ENTITY_TEST_RE = /^#((?:x[a-f0-9]{1,8}|[0-9]{1,8}))$/i;
640
+ function replaceEntityPattern(match, name) {
641
+ if (name.charCodeAt(0) === 35 && DIGITAL_ENTITY_TEST_RE.test(name)) {
642
+ const code = name[1].toLowerCase() === "x" ? parseInt(name.slice(2), 16) : parseInt(name.slice(1), 10);
643
+ if (isValidEntityCode(code)) return fromCodePoint(code);
644
+ return match;
645
+ }
646
+ const decoded = decodeHTMLStrict(match);
647
+ if (decoded !== match) return decoded;
648
+ return match;
649
+ }
650
+ /** Decodes Markdown backslash escapes. */
651
+ function unescapeMd(str) {
652
+ if (str.indexOf("\\") < 0) return str;
653
+ return str.replace(UNESCAPE_MD_RE, "$1");
654
+ }
655
+ /**
656
+ * Decodes Markdown backslash escapes and HTML character references in link
657
+ * destinations, link titles, and fenced code info strings.
658
+ */
659
+ function unescapeAll(str) {
660
+ if (str.indexOf("\\") < 0 && str.indexOf("&") < 0) return str;
661
+ return str.replace(UNESCAPE_ALL_RE, function(match, escaped, entity) {
662
+ if (escaped) return escaped;
663
+ return replaceEntityPattern(match, entity);
664
+ });
665
+ }
666
+ var HTML_ESCAPE_TEST_RE = /[&<>"]/;
667
+ var HTML_ESCAPE_REPLACE_RE = /[&<>"]/g;
668
+ var HTML_REPLACEMENTS = {
669
+ "&": "&amp;",
670
+ "<": "&lt;",
671
+ ">": "&gt;",
672
+ "\"": "&quot;"
673
+ };
674
+ function replaceUnsafeChar(ch) {
675
+ return HTML_REPLACEMENTS[ch];
676
+ }
677
+ /** Escapes HTML special characters in a string. */
678
+ function escapeHtml(str) {
679
+ if (HTML_ESCAPE_TEST_RE.test(str)) return str.replace(HTML_ESCAPE_REPLACE_RE, replaceUnsafeChar);
680
+ return str;
681
+ }
682
+ var REGEXP_ESCAPE_RE = /[.?*+^$[\]\\(){}|-]/g;
683
+ /** Escapes regular expression metacharacters in a string. */
684
+ function escapeRE(str) {
685
+ return str.replace(REGEXP_ESCAPE_RE, "\\$&");
686
+ }
687
+ /** Checks whether a character code is an ASCII space or tab. */
688
+ function isSpace(code) {
689
+ switch (code) {
690
+ case 9:
691
+ case 32: return true;
692
+ }
693
+ return false;
694
+ }
695
+ /**
696
+ * Checks whether a character code is whitespace recognized by Markdown.
697
+ *
698
+ * Matches the Unicode `Zs` category or `\t`, `\f`, `\v`, `\r`, `\n`.
699
+ */
700
+ function isWhiteSpace(code) {
701
+ if (code >= 8192 && code <= 8202) return true;
702
+ switch (code) {
703
+ case 9:
704
+ case 10:
705
+ case 11:
706
+ case 12:
707
+ case 13:
708
+ case 32:
709
+ case 160:
710
+ case 5760:
711
+ case 8239:
712
+ case 8287:
713
+ case 12288: return true;
714
+ }
715
+ return false;
716
+ }
717
+ /**
718
+ * Checks whether a character is Unicode punctuation or a symbol.
719
+ *
720
+ * Does not support astral characters.
721
+ */
722
+ function isPunctChar(ch) {
723
+ return uc_micro.P.test(ch) || uc_micro.S.test(ch);
724
+ }
725
+ /** Checks whether a Unicode code point is punctuation or a symbol. */
726
+ function isPunctCharCode(code) {
727
+ return isPunctChar(fromCodePoint(code));
728
+ }
729
+ /**
730
+ * Markdown ASCII punctuation characters.
731
+ *
732
+ * !, ", #, $, %, &, ', (, ), *, +, ,, -, ., /, :, ;, <, =, >, ?, @,
733
+ * [, \, ], ^, _, `, {, |, }, or ~
734
+ *
735
+ * http://spec.commonmark.org/0.15/#ascii-punctuation-character
736
+ *
737
+ * Don't confuse with Unicode punctuation. It lacks some characters in the
738
+ * ASCII range.
739
+ */
740
+ function isMdAsciiPunct(ch) {
741
+ switch (ch) {
742
+ case 33:
743
+ case 34:
744
+ case 35:
745
+ case 36:
746
+ case 37:
747
+ case 38:
748
+ case 39:
749
+ case 40:
750
+ case 41:
751
+ case 42:
752
+ case 43:
753
+ case 44:
754
+ case 45:
755
+ case 46:
756
+ case 47:
757
+ case 58:
758
+ case 59:
759
+ case 60:
760
+ case 61:
761
+ case 62:
762
+ case 63:
763
+ case 64:
764
+ case 91:
765
+ case 92:
766
+ case 93:
767
+ case 94:
768
+ case 95:
769
+ case 96:
770
+ case 123:
771
+ case 124:
772
+ case 125:
773
+ case 126: return true;
774
+ default: return false;
775
+ }
776
+ }
777
+ /** Normalizes `[reference labels]` for case-insensitive lookup. */
778
+ function normalizeReference(str) {
779
+ str = str.trim().replace(/\s+/g, " ");
780
+ return str.toLowerCase().toUpperCase();
781
+ }
782
+ function isAsciiTrimmable(c) {
783
+ return c === 32 || c === 9 || c === 10 || c === 13;
784
+ }
785
+ /**
786
+ * "Light" `.trim()` for blocks (headings, paragraphs), where Unicode spaces
787
+ * should be preserved.
788
+ */
789
+ function asciiTrim(str) {
790
+ let start = 0;
791
+ for (; start < str.length; start++) if (!isAsciiTrimmable(str.charCodeAt(start))) break;
792
+ let end = str.length - 1;
793
+ for (; end >= start; end--) if (!isAsciiTrimmable(str.charCodeAt(end))) break;
794
+ return str.slice(start, end + 1);
795
+ }
796
+ /**
797
+ * Libraries commonly used by markdown-it and its plugins, re-exported to
798
+ * reduce duplicate dependencies in browser bundles.
799
+ */
800
+ var lib = {
801
+ mdurl,
802
+ ucmicro: uc_micro
803
+ };
804
+ //#endregion
805
+ //#region src/helpers/parse_link_label.ts
806
+ /** Finds the end of a link or image label (`[label]`). */
807
+ function parseLinkLabel(state, start, disableNested) {
808
+ let level, found, marker, prevPos;
809
+ const max = state.posMax;
810
+ const oldPos = state.pos;
811
+ state.pos = start + 1;
812
+ level = 1;
813
+ while (state.pos < max) {
814
+ marker = state.src.charCodeAt(state.pos);
815
+ if (marker === 93) {
816
+ level--;
817
+ if (level === 0) {
818
+ found = true;
819
+ break;
820
+ }
821
+ }
822
+ prevPos = state.pos;
823
+ state.md.inline.skipToken(state);
824
+ if (marker === 91) {
825
+ if (prevPos === state.pos - 1) level++;
826
+ else if (disableNested) {
827
+ state.pos = oldPos;
828
+ return -1;
829
+ }
830
+ }
831
+ }
832
+ let labelEnd = -1;
833
+ if (found) labelEnd = state.pos;
834
+ state.pos = oldPos;
835
+ return labelEnd;
836
+ }
837
+ //#endregion
838
+ //#region src/helpers/parse_link_destination.ts
839
+ /** Parses the destination in `[label](destination "title")`. */
840
+ function parseLinkDestination(str, start, max) {
841
+ let code;
842
+ let pos = start;
843
+ const result = {
844
+ ok: false,
845
+ pos: 0,
846
+ str: ""
847
+ };
848
+ if (str.charCodeAt(pos) === 60) {
849
+ pos++;
850
+ while (pos < max) {
851
+ code = str.charCodeAt(pos);
852
+ if (code === 10) return result;
853
+ if (code === 60) return result;
854
+ if (code === 62) {
855
+ result.pos = pos + 1;
856
+ result.str = unescapeAll(str.slice(start + 1, pos));
857
+ result.ok = true;
858
+ return result;
859
+ }
860
+ if (code === 92 && pos + 1 < max) {
861
+ pos += 2;
862
+ continue;
863
+ }
864
+ pos++;
865
+ }
866
+ return result;
867
+ }
868
+ let level = 0;
869
+ while (pos < max) {
870
+ code = str.charCodeAt(pos);
871
+ if (code === 32) break;
872
+ if (code < 32 || code === 127) break;
873
+ if (code === 92 && pos + 1 < max) {
874
+ if (str.charCodeAt(pos + 1) === 32) {
875
+ pos++;
876
+ continue;
877
+ }
878
+ pos += 2;
879
+ continue;
880
+ }
881
+ if (code === 40) {
882
+ level++;
883
+ if (level > 32) return result;
884
+ }
885
+ if (code === 41) {
886
+ if (level === 0) break;
887
+ level--;
888
+ }
889
+ pos++;
890
+ }
891
+ if (start === pos) return result;
892
+ if (level !== 0) return result;
893
+ result.str = unescapeAll(str.slice(start, pos));
894
+ result.pos = pos;
895
+ result.ok = true;
896
+ return result;
897
+ }
898
+ //#endregion
899
+ //#region src/helpers/parse_link_title.ts
900
+ /**
901
+ * Parses the optional title in `[label](destination "title")` or
902
+ * `[label]: destination "title"`.
903
+ *
904
+ * `prev_state` continues a reference title on the next source line.
905
+ */
906
+ function parseLinkTitle(str, start, max, prev_state) {
907
+ let code;
908
+ let pos = start;
909
+ const state = {
910
+ ok: false,
911
+ can_continue: false,
912
+ pos: 0,
913
+ str: "",
914
+ marker: 0
915
+ };
916
+ if (prev_state) {
917
+ state.str = prev_state.str;
918
+ state.marker = prev_state.marker;
919
+ } else {
920
+ if (pos >= max) return state;
921
+ let marker = str.charCodeAt(pos);
922
+ if (marker !== 34 && marker !== 39 && marker !== 40) return state;
923
+ start++;
924
+ pos++;
925
+ if (marker === 40) marker = 41;
926
+ state.marker = marker;
927
+ }
928
+ while (pos < max) {
929
+ code = str.charCodeAt(pos);
930
+ if (code === state.marker) {
931
+ state.pos = pos + 1;
932
+ state.str += unescapeAll(str.slice(start, pos));
933
+ state.ok = true;
934
+ return state;
935
+ } else if (code === 40 && state.marker === 41) return state;
936
+ else if (code === 92 && pos + 1 < max) pos++;
937
+ pos++;
938
+ }
939
+ state.can_continue = true;
940
+ state.str += unescapeAll(str.slice(start, pos));
941
+ return state;
942
+ }
943
+ //#endregion
944
+ //#region src/helpers/index.ts
945
+ /**
946
+ * Functions used to parse links and images, split out of parser rules because
947
+ * of their size.
948
+ *
949
+ * @module md.helpers
950
+ */
951
+ var helpers_exports = /* @__PURE__ */ __exportAll({
952
+ parseLinkDestination: () => parseLinkDestination,
953
+ parseLinkLabel: () => parseLinkLabel,
954
+ parseLinkTitle: () => parseLinkTitle
955
+ });
956
+ //#endregion
957
+ //#region src/token.ts
958
+ /**
959
+ * Represents one item in the parsed token stream, storing parsed data and
960
+ * providing helpers for managing HTML attributes.
961
+ */
962
+ var Token = class {
963
+ constructor(type, tag, nesting) {
964
+ _defineProperty(
965
+ this,
966
+ /**
967
+ * Source map info. Format: `[ line_begin, line_end ]`
968
+ */
969
+ "map",
970
+ null
971
+ );
972
+ _defineProperty(
973
+ this,
974
+ /**
975
+ * nesting level, the same as `state.level`
976
+ */
977
+ "level",
978
+ 0
979
+ );
980
+ _defineProperty(
981
+ this,
982
+ /**
983
+ * An array of child nodes (inline and img tokens)
984
+ */
985
+ "children",
986
+ null
987
+ );
988
+ _defineProperty(
989
+ this,
990
+ /**
991
+ * In a case of self-closing tag (code, html, fence, etc.),
992
+ * it has contents of this tag.
993
+ */
994
+ "content",
995
+ ""
996
+ );
997
+ _defineProperty(
998
+ this,
999
+ /**
1000
+ * '*' or '_' for emphasis, fence string for fence, etc.
1001
+ */
1002
+ "markup",
1003
+ ""
1004
+ );
1005
+ _defineProperty(
1006
+ this,
1007
+ /**
1008
+ * Additional information:
1009
+ *
1010
+ * - Info string for "fence" tokens
1011
+ * - The value "auto" for autolink "link_open" and "link_close" tokens
1012
+ * - The string value of the item marker for ordered-list "list_item_open" tokens
1013
+ */
1014
+ "info",
1015
+ ""
1016
+ );
1017
+ _defineProperty(
1018
+ this,
1019
+ /**
1020
+ * True for block-level tokens, false for inline tokens.
1021
+ * Used in renderer to calculate line breaks
1022
+ */
1023
+ "block",
1024
+ false
1025
+ );
1026
+ _defineProperty(
1027
+ this,
1028
+ /**
1029
+ * If it's true, ignore this element when rendering. Used for tight lists
1030
+ * to hide paragraphs.
1031
+ */
1032
+ "hidden",
1033
+ false
1034
+ );
1035
+ this.type = type;
1036
+ this.tag = tag;
1037
+ this.attrs = null;
1038
+ this.nesting = nesting;
1039
+ this.meta = null;
1040
+ }
1041
+ /**
1042
+ * Search attribute index by name.
1043
+ */
1044
+ attrIndex(name) {
1045
+ if (!this.attrs) return -1;
1046
+ const attrs = this.attrs;
1047
+ for (let i = 0, len = attrs.length; i < len; i++) if (attrs[i][0] === name) return i;
1048
+ return -1;
1049
+ }
1050
+ /**
1051
+ * Add `[ name, value ]` attribute to list. Init attrs if necessary
1052
+ */
1053
+ attrPush(attrData) {
1054
+ if (this.attrs) this.attrs.push(attrData);
1055
+ else this.attrs = [attrData];
1056
+ }
1057
+ /**
1058
+ * Set `name` attribute to `value`. Override old value if exists.
1059
+ */
1060
+ attrSet(name, value) {
1061
+ const idx = this.attrIndex(name);
1062
+ const attrData = [name, value];
1063
+ if (idx < 0) this.attrPush(attrData);
1064
+ else this.attrs[idx] = attrData;
1065
+ }
1066
+ /**
1067
+ * Get the value of attribute `name`, or null if it does not exist.
1068
+ */
1069
+ attrGet(name) {
1070
+ const idx = this.attrIndex(name);
1071
+ let value = null;
1072
+ if (idx >= 0) value = this.attrs[idx][1];
1073
+ return value;
1074
+ }
1075
+ /**
1076
+ * Join value to existing attribute via space. Or create new attribute if not
1077
+ * exists. Useful to operate with token classes.
1078
+ */
1079
+ attrJoin(name, value) {
1080
+ const idx = this.attrIndex(name);
1081
+ if (idx < 0) this.attrPush([name, value]);
1082
+ else this.attrs[idx][1] = `${this.attrs[idx][1]} ${value}`;
1083
+ }
1084
+ };
1085
+ //#endregion
1086
+ //#region src/ruler.ts
1087
+ /**
1088
+ * Helper class, used by {@link MarkdownIt.core}, {@link MarkdownIt.block} and
1089
+ * {@link MarkdownIt.inline} to manage sequences of functions (rules):
1090
+ *
1091
+ * - keep rules in defined order
1092
+ * - assign the name to each rule
1093
+ * - enable/disable rules
1094
+ * - add/replace rules
1095
+ * - allow assign rules to additional named chains (in the same)
1096
+ * - cacheing lists of active rules
1097
+ *
1098
+ * You will not need use this class directly until write plugins. For simple
1099
+ * rules control use {@link MarkdownIt.disable}, {@link MarkdownIt.enable} and
1100
+ * {@link MarkdownIt.use}.
1101
+ */
1102
+ var Ruler = class {
1103
+ constructor() {
1104
+ _defineProperty(
1105
+ this,
1106
+ /** @internal */
1107
+ "__rules__",
1108
+ []
1109
+ );
1110
+ _defineProperty(
1111
+ this,
1112
+ /** @internal */
1113
+ "__cache__",
1114
+ null
1115
+ );
1116
+ }
1117
+ /** @internal */
1118
+ __find__(name) {
1119
+ for (let i = 0; i < this.__rules__.length; i++) if (this.__rules__[i].name === name) return i;
1120
+ return -1;
1121
+ }
1122
+ /** @internal */
1123
+ __compile__() {
1124
+ const chains = /* @__PURE__ */ new Set();
1125
+ this.__rules__.forEach((rule) => {
1126
+ if (!rule.enabled) return;
1127
+ rule.alt.forEach((altName) => {
1128
+ if (altName) chains.add(altName);
1129
+ });
1130
+ });
1131
+ this.__cache__ = Object.create(null);
1132
+ this.__cache__[""] = [];
1133
+ this.__rules__.forEach((rule) => {
1134
+ if (rule.enabled) this.__cache__[""].push(rule.fn);
1135
+ });
1136
+ chains.forEach((chain) => {
1137
+ this.__cache__[chain] = [];
1138
+ this.__rules__.forEach((rule) => {
1139
+ if (rule.enabled && rule.alt.indexOf(chain) >= 0) this.__cache__[chain].push(rule.fn);
1140
+ });
1141
+ });
1142
+ }
1143
+ /**
1144
+ * Replace rule by name with new function & options. Throws error if name not
1145
+ * found.
1146
+ *
1147
+ * @example Replace existing typographer replacement rule with new one
1148
+ * ```javascript
1149
+ * import MarkdownIt from 'markdown-it'
1150
+ * const md = new MarkdownIt()
1151
+ *
1152
+ * md.core.ruler.at('replacements', function replace(state) {
1153
+ * //...
1154
+ * });
1155
+ * ```
1156
+ */
1157
+ at(name, fn, options = {}) {
1158
+ const index = this.__find__(name);
1159
+ if (index === -1) throw new Error(`Parser rule not found: ${name}`);
1160
+ this.__rules__[index].fn = fn;
1161
+ this.__rules__[index].alt = options.alt || [];
1162
+ this.__cache__ = null;
1163
+ }
1164
+ /**
1165
+ * Add new rule to chain before one with given name. See also
1166
+ * {@link Ruler.after}, {@link Ruler.push}.
1167
+ *
1168
+ * @example
1169
+ * ```javascript
1170
+ * import MarkdownIt from 'markdown-it'
1171
+ * const md = new MarkdownIt()
1172
+ *
1173
+ * md.block.ruler.before('paragraph', 'my_rule', function replace(state) {
1174
+ * //...
1175
+ * });
1176
+ * ```
1177
+ */
1178
+ before(beforeName, ruleName, fn, options = {}) {
1179
+ const index = this.__find__(beforeName);
1180
+ if (index === -1) throw new Error(`Parser rule not found: ${beforeName}`);
1181
+ this.__rules__.splice(index, 0, {
1182
+ name: ruleName,
1183
+ enabled: true,
1184
+ fn,
1185
+ alt: options.alt || []
1186
+ });
1187
+ this.__cache__ = null;
1188
+ }
1189
+ /**
1190
+ * Add new rule to chain after one with given name. See also
1191
+ * {@link Ruler.before}, {@link Ruler.push}.
1192
+ *
1193
+ * @example
1194
+ * ```javascript
1195
+ * import MarkdownIt from 'markdown-it'
1196
+ * const md = new MarkdownIt()
1197
+ *
1198
+ * md.inline.ruler.after('text', 'my_rule', function replace(state) {
1199
+ * //...
1200
+ * });
1201
+ * ```
1202
+ */
1203
+ after(afterName, ruleName, fn, options = {}) {
1204
+ const index = this.__find__(afterName);
1205
+ if (index === -1) throw new Error(`Parser rule not found: ${afterName}`);
1206
+ this.__rules__.splice(index + 1, 0, {
1207
+ name: ruleName,
1208
+ enabled: true,
1209
+ fn,
1210
+ alt: options.alt || []
1211
+ });
1212
+ this.__cache__ = null;
1213
+ }
1214
+ /**
1215
+ * Push new rule to the end of chain. See also
1216
+ * {@link Ruler.before}, {@link Ruler.after}.
1217
+ *
1218
+ * @example
1219
+ * ```javascript
1220
+ * import MarkdownIt from 'markdown-it'
1221
+ * const md = new MarkdownIt()
1222
+ *
1223
+ * md.core.ruler.push('my_rule', function replace(state) {
1224
+ * //...
1225
+ * });
1226
+ * ```
1227
+ */
1228
+ push(ruleName, fn, options = {}) {
1229
+ this.__rules__.push({
1230
+ name: ruleName,
1231
+ enabled: true,
1232
+ fn,
1233
+ alt: options.alt || []
1234
+ });
1235
+ this.__cache__ = null;
1236
+ }
1237
+ /**
1238
+ * Enable rules with given names. If any rule name not found - throw Error.
1239
+ * Errors can be disabled by second param.
1240
+ *
1241
+ * See also {@link Ruler.disable}, {@link Ruler.enableOnly}.
1242
+ *
1243
+ * Returns list of found rule names (if no exception happened).
1244
+ */
1245
+ enable(list, ignoreInvalid = false) {
1246
+ if (!Array.isArray(list)) list = [list];
1247
+ const result = [];
1248
+ list.forEach((name) => {
1249
+ const idx = this.__find__(name);
1250
+ if (idx < 0) {
1251
+ if (ignoreInvalid) return;
1252
+ throw new Error(`Rules manager: invalid rule name ${name}`);
1253
+ }
1254
+ this.__rules__[idx].enabled = true;
1255
+ result.push(name);
1256
+ });
1257
+ this.__cache__ = null;
1258
+ return result;
1259
+ }
1260
+ /**
1261
+ * Enable rules with given names, and disable everything else. If any rule name
1262
+ * not found - throw Error. Errors can be disabled by second param.
1263
+ *
1264
+ * See also {@link Ruler.disable}, {@link Ruler.enable}.
1265
+ */
1266
+ enableOnly(list, ignoreInvalid = false) {
1267
+ if (!Array.isArray(list)) list = [list];
1268
+ this.__rules__.forEach((rule) => {
1269
+ rule.enabled = false;
1270
+ });
1271
+ this.enable(list, ignoreInvalid);
1272
+ }
1273
+ /**
1274
+ * Disable rules with given names. If any rule name not found - throw Error.
1275
+ * Errors can be disabled by second param.
1276
+ *
1277
+ * See also {@link Ruler.enable}, {@link Ruler.enableOnly}.
1278
+ *
1279
+ * Returns list of found rule names (if no exception happened).
1280
+ */
1281
+ disable(list, ignoreInvalid = false) {
1282
+ if (!Array.isArray(list)) list = [list];
1283
+ const result = [];
1284
+ list.forEach((name) => {
1285
+ const idx = this.__find__(name);
1286
+ if (idx < 0) {
1287
+ if (ignoreInvalid) return;
1288
+ throw new Error(`Rules manager: invalid rule name ${name}`);
1289
+ }
1290
+ this.__rules__[idx].enabled = false;
1291
+ result.push(name);
1292
+ });
1293
+ this.__cache__ = null;
1294
+ return result;
1295
+ }
1296
+ /**
1297
+ * Return array of active functions (rules) for given chain name. It analyzes
1298
+ * rules configuration, compiles caches if not exists and returns result.
1299
+ *
1300
+ * Default chain name is `''` (empty string). It can't be skipped. That's
1301
+ * done intentionally, to keep signature monomorphic for high speed.
1302
+ */
1303
+ getRules(chainName) {
1304
+ if (!this.__cache__) this.__compile__();
1305
+ return this.__cache__[chainName] || [];
1306
+ }
1307
+ };
1308
+ //#endregion
1309
+ //#region src/renderer.ts
1310
+ var default_rules = {};
1311
+ default_rules.code_inline = function(tokens, idx, options, env, slf) {
1312
+ const token = tokens[idx];
1313
+ return `<code${slf.renderAttrs(token)}>${escapeHtml(token.content)}</code>`;
1314
+ };
1315
+ default_rules.code_block = function(tokens, idx, options, env, slf) {
1316
+ const token = tokens[idx];
1317
+ return `<pre${slf.renderAttrs(token)}><code>${escapeHtml(tokens[idx].content)}</code></pre>\n`;
1318
+ };
1319
+ default_rules.fence = function(tokens, idx, options, env, slf) {
1320
+ const token = tokens[idx];
1321
+ const info = token.info ? unescapeAll(token.info).trim() : "";
1322
+ let langName = "";
1323
+ let langAttrs = "";
1324
+ if (info) {
1325
+ const arr = info.split(/(\s+)/g);
1326
+ langName = arr[0];
1327
+ langAttrs = arr.slice(2).join("");
1328
+ }
1329
+ let highlighted;
1330
+ if (options.highlight) highlighted = options.highlight(token.content, langName, langAttrs) || escapeHtml(token.content);
1331
+ else highlighted = escapeHtml(token.content);
1332
+ if (highlighted.indexOf("<pre") === 0) return highlighted + "\n";
1333
+ if (info) {
1334
+ const i = token.attrIndex("class");
1335
+ const tmpAttrs = token.attrs ? token.attrs.slice() : [];
1336
+ if (i < 0) tmpAttrs.push(["class", `${options.langPrefix}${langName}`]);
1337
+ else {
1338
+ tmpAttrs[i] = [tmpAttrs[i][0], tmpAttrs[i][1]];
1339
+ tmpAttrs[i][1] += ` ${options.langPrefix}${langName}`;
1340
+ }
1341
+ const tmpToken = { attrs: tmpAttrs };
1342
+ return `<pre><code${slf.renderAttrs(tmpToken)}>${highlighted}</code></pre>\n`;
1343
+ }
1344
+ return `<pre><code${slf.renderAttrs(token)}>${highlighted}</code></pre>\n`;
1345
+ };
1346
+ default_rules.image = function(tokens, idx, options, env, slf) {
1347
+ const token = tokens[idx];
1348
+ token.attrs[token.attrIndex("alt")][1] = slf.renderInlineAsText(token.children, options, env);
1349
+ return slf.renderToken(tokens, idx, options);
1350
+ };
1351
+ default_rules.hardbreak = function(tokens, idx, options) {
1352
+ return options.xhtmlOut ? "<br />\n" : "<br>\n";
1353
+ };
1354
+ default_rules.softbreak = function(tokens, idx, options) {
1355
+ return options.breaks ? options.xhtmlOut ? "<br />\n" : "<br>\n" : "\n";
1356
+ };
1357
+ default_rules.text = function(tokens, idx) {
1358
+ return escapeHtml(tokens[idx].content);
1359
+ };
1360
+ default_rules.html_block = function(tokens, idx) {
1361
+ return tokens[idx].content;
1362
+ };
1363
+ default_rules.html_inline = function(tokens, idx) {
1364
+ return tokens[idx].content;
1365
+ };
1366
+ /**
1367
+ * Generates HTML from parsed token stream. Each instance has independent
1368
+ * copy of rules. Those can be rewritten with ease. Also, you can add new
1369
+ * rules if you create plugin and adds new token types.
1370
+ *
1371
+ * Creates new renderer instance and fills {@link Renderer.rules} with defaults.
1372
+ */
1373
+ var Renderer = class {
1374
+ constructor() {
1375
+ _defineProperty(
1376
+ this,
1377
+ /**
1378
+ * Contains render rules for tokens. Can be updated and extended.
1379
+ *
1380
+ * See [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts)
1381
+ * for more details and examples.
1382
+ *
1383
+ * @example Custom render rules
1384
+ * ```javascript
1385
+ * import MarkdownIt from 'markdown-it'
1386
+ * const md = new MarkdownIt()
1387
+ *
1388
+ * md.renderer.rules.strong_open = function () { return '<b>'; };
1389
+ * md.renderer.rules.strong_close = function () { return '</b>'; };
1390
+ *
1391
+ * const result = md.renderInline(...);
1392
+ * ```
1393
+ *
1394
+ * @example Each rule is called as independent static function with fixed signature
1395
+ * ```javascript
1396
+ * function my_token_render(tokens, idx, options, env, renderer) {
1397
+ * // ...
1398
+ * return renderedHTML;
1399
+ * }
1400
+ * ```
1401
+ */
1402
+ "rules",
1403
+ Object.assign({}, default_rules)
1404
+ );
1405
+ }
1406
+ /**
1407
+ * Render token attributes to string.
1408
+ */
1409
+ renderAttrs(token) {
1410
+ let i, l, result;
1411
+ if (!token.attrs) return "";
1412
+ result = "";
1413
+ for (i = 0, l = token.attrs.length; i < l; i++) result += ` ${escapeHtml(token.attrs[i][0])}="${escapeHtml(String(token.attrs[i][1]))}"`;
1414
+ return result;
1415
+ }
1416
+ /**
1417
+ * Default token renderer. Can be overriden by custom function
1418
+ * in {@link Renderer.rules}.
1419
+ */
1420
+ renderToken(tokens, idx, options) {
1421
+ const token = tokens[idx];
1422
+ let result = "";
1423
+ if (token.hidden) return "";
1424
+ let prev = idx - 1;
1425
+ while (prev >= 0 && tokens[prev].hidden && tokens[prev].nesting === 0) prev--;
1426
+ if (token.block && token.nesting !== -1 && prev >= 0 && tokens[prev].hidden && tokens[prev].nesting === -1) result += "\n";
1427
+ result += (token.nesting === -1 ? "</" : "<") + token.tag;
1428
+ result += this.renderAttrs(token);
1429
+ if (token.nesting === 0 && options.xhtmlOut) result += " /";
1430
+ let needLf = false;
1431
+ if (token.block) {
1432
+ needLf = true;
1433
+ if (token.nesting === 1) {
1434
+ let next = idx + 1;
1435
+ while (next < tokens.length && tokens[next].hidden && tokens[next].nesting === 0) next++;
1436
+ if (next < tokens.length) {
1437
+ const nextToken = tokens[next];
1438
+ if (nextToken.type === "inline" || nextToken.hidden) needLf = false;
1439
+ else if (nextToken.nesting === -1 && nextToken.tag === token.tag) needLf = false;
1440
+ }
1441
+ }
1442
+ }
1443
+ result += needLf ? ">\n" : ">";
1444
+ return result;
1445
+ }
1446
+ /**
1447
+ * The same as {@link Renderer.render}, but for single token of `inline` type.
1448
+ */
1449
+ renderInline(tokens, options, env) {
1450
+ let result = "";
1451
+ const rules = this.rules;
1452
+ for (let i = 0, len = tokens.length; i < len; i++) {
1453
+ const type = tokens[i].type;
1454
+ if (typeof rules[type] !== "undefined") result += rules[type](tokens, i, options, env, this);
1455
+ else result += this.renderToken(tokens, i, options);
1456
+ }
1457
+ return result;
1458
+ }
1459
+ /**
1460
+ * Special kludge for image `alt` attributes to conform CommonMark spec.
1461
+ * Don't try to use it! Spec requires to show `alt` content with stripped markup,
1462
+ * instead of simple escaping.
1463
+ */
1464
+ renderInlineAsText(tokens, options, env) {
1465
+ let result = "";
1466
+ for (let i = 0, len = tokens.length; i < len; i++) switch (tokens[i].type) {
1467
+ case "text":
1468
+ case "code_inline":
1469
+ result += tokens[i].content;
1470
+ break;
1471
+ case "image":
1472
+ result += this.renderInlineAsText(tokens[i].children, options, env);
1473
+ break;
1474
+ case "html_inline":
1475
+ case "html_block":
1476
+ result += tokens[i].content;
1477
+ break;
1478
+ case "softbreak":
1479
+ case "hardbreak": result += "\n";
1480
+ }
1481
+ return result;
1482
+ }
1483
+ /**
1484
+ * Takes token stream and generates HTML. Probably, you will never need to call
1485
+ * this method directly.
1486
+ */
1487
+ render(tokens, options, env) {
1488
+ let result = "";
1489
+ const rules = this.rules;
1490
+ for (let i = 0, len = tokens.length; i < len; i++) {
1491
+ const type = tokens[i].type;
1492
+ if (type === "inline") result += this.renderInline(tokens[i].children, options, env);
1493
+ else if (typeof rules[type] !== "undefined") result += rules[type](tokens, i, options, env, this);
1494
+ else result += this.renderToken(tokens, i, options);
1495
+ }
1496
+ return result;
1497
+ }
1498
+ };
1499
+ //#endregion
1500
+ //#region src/rules_core/state_core.ts
1501
+ /** Mutable state passed through the core rules chain. */
1502
+ var StateCore = class {
1503
+ constructor(src, md, env) {
1504
+ _defineProperty(this, "tokens", []);
1505
+ _defineProperty(this, "inlineMode", false);
1506
+ _defineProperty(this, "Token", Token);
1507
+ this.src = src;
1508
+ this.env = env;
1509
+ this.md = md;
1510
+ }
1511
+ };
1512
+ //#endregion
1513
+ //#region src/rules_core/normalize.ts
1514
+ var UNNORMALIZED_NEWLINE_RE = /\r\n?/g;
1515
+ var NULL_RE = /\0/g;
1516
+ function normalize(state) {
1517
+ let str;
1518
+ str = state.src.replace(UNNORMALIZED_NEWLINE_RE, "\n");
1519
+ str = str.replace(NULL_RE, "�");
1520
+ state.src = str;
1521
+ }
1522
+ //#endregion
1523
+ //#region src/rules_core/block.ts
1524
+ function block(state) {
1525
+ let token;
1526
+ if (state.inlineMode) {
1527
+ token = new state.Token("inline", "", 0);
1528
+ token.content = state.src;
1529
+ token.map = [0, 1];
1530
+ token.children = [];
1531
+ state.tokens.push(token);
1532
+ } else state.md.block.parse(state.src, state.md, state.env, state.tokens);
1533
+ }
1534
+ //#endregion
1535
+ //#region src/rules_core/strip_references.ts
1536
+ function strip_references(state) {
1537
+ const tokens = state.tokens;
1538
+ let last = 0;
1539
+ for (let curr = 0; curr < tokens.length; curr++) {
1540
+ if (tokens[curr].type === "reference_definition") continue;
1541
+ if (curr !== last) tokens[last] = tokens[curr];
1542
+ last++;
1543
+ }
1544
+ if (tokens.length !== last) tokens.length = last;
1545
+ }
1546
+ //#endregion
1547
+ //#region src/rules_core/inline.ts
1548
+ function inline(state) {
1549
+ const tokens = state.tokens;
1550
+ for (let i = 0, l = tokens.length; i < l; i++) {
1551
+ const tok = tokens[i];
1552
+ if (tok.type === "inline") state.md.inline.parse(tok.content, state.md, state.env, tok.children);
1553
+ }
1554
+ }
1555
+ //#endregion
1556
+ //#region src/rules_core/linkify.ts
1557
+ function isLinkOpen$1(str) {
1558
+ return /^<a[>\s]/i.test(str);
1559
+ }
1560
+ function isLinkClose$1(str) {
1561
+ return /^<\/a\s*>/i.test(str);
1562
+ }
1563
+ function linkify$1(state) {
1564
+ const blockTokens = state.tokens;
1565
+ if (!state.md.options.linkify) return;
1566
+ for (let j = 0, l = blockTokens.length; j < l; j++) {
1567
+ if (blockTokens[j].type !== "inline" || !state.md.linkify.test(blockTokens[j].content)) continue;
1568
+ const tokens = blockTokens[j].children;
1569
+ const replacements = [];
1570
+ let htmlLinkLevel = 0;
1571
+ for (let i = tokens.length - 1; i >= 0; i--) {
1572
+ const currentToken = tokens[i];
1573
+ if (currentToken.type === "link_close") {
1574
+ i--;
1575
+ while (tokens[i].level !== currentToken.level && tokens[i].type !== "link_open") i--;
1576
+ continue;
1577
+ }
1578
+ if (currentToken.type === "html_inline") {
1579
+ if (isLinkOpen$1(currentToken.content) && htmlLinkLevel > 0) htmlLinkLevel--;
1580
+ if (isLinkClose$1(currentToken.content)) htmlLinkLevel++;
1581
+ }
1582
+ if (htmlLinkLevel > 0) continue;
1583
+ if (currentToken.type === "text" && state.md.linkify.test(currentToken.content)) {
1584
+ const text = currentToken.content;
1585
+ let links = state.md.linkify.match(text);
1586
+ const nodes = [];
1587
+ let level = currentToken.level;
1588
+ let lastPos = 0;
1589
+ if (links.length > 0 && links[0].index === 0 && i > 0 && tokens[i - 1].type === "text_special") links = links.slice(1);
1590
+ for (let ln = 0; ln < links.length; ln++) {
1591
+ const url = links[ln].url;
1592
+ const fullUrl = state.md.normalizeLink(url);
1593
+ if (!state.md.validateLink(fullUrl)) continue;
1594
+ let urlText = links[ln].text;
1595
+ if (!links[ln].schema) urlText = state.md.normalizeLinkText(`http://${urlText}`).replace(/^http:\/\//, "");
1596
+ else if (links[ln].schema === "mailto:" && !/^mailto:/i.test(urlText)) urlText = state.md.normalizeLinkText(`mailto:${urlText}`).replace(/^mailto:/, "");
1597
+ else urlText = state.md.normalizeLinkText(urlText);
1598
+ const pos = links[ln].index;
1599
+ if (pos > lastPos) {
1600
+ const token = new state.Token("text", "", 0);
1601
+ token.content = text.slice(lastPos, pos);
1602
+ token.level = level;
1603
+ nodes.push(token);
1604
+ }
1605
+ const token_o = new state.Token("link_open", "a", 1);
1606
+ token_o.attrs = [["href", fullUrl]];
1607
+ token_o.level = level++;
1608
+ token_o.markup = "linkify";
1609
+ token_o.info = "auto";
1610
+ nodes.push(token_o);
1611
+ const token_t = new state.Token("text", "", 0);
1612
+ token_t.content = urlText;
1613
+ token_t.level = level;
1614
+ nodes.push(token_t);
1615
+ const token_c = new state.Token("link_close", "a", -1);
1616
+ token_c.level = --level;
1617
+ token_c.markup = "linkify";
1618
+ token_c.info = "auto";
1619
+ nodes.push(token_c);
1620
+ lastPos = links[ln].lastIndex;
1621
+ }
1622
+ if (lastPos < text.length) {
1623
+ const token = new state.Token("text", "", 0);
1624
+ token.content = text.slice(lastPos);
1625
+ token.level = level;
1626
+ nodes.push(token);
1627
+ }
1628
+ replacements.push({
1629
+ index: i,
1630
+ nodes
1631
+ });
1632
+ }
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
+ }
1650
+ }
1651
+ }
1652
+ //#endregion
1653
+ //#region src/rules_core/replacements.ts
1654
+ var RARE_RE = /\+-|\.\.|\?\?\?\?|!!!!|,,|--/;
1655
+ var SCOPED_ABBR_TEST_RE = /\((c|tm|r)\)/i;
1656
+ var SCOPED_ABBR_RE = /\((c|tm|r)\)/gi;
1657
+ var SCOPED_ABBR = {
1658
+ c: "©",
1659
+ r: "®",
1660
+ tm: "™"
1661
+ };
1662
+ function replaceFn(match, name) {
1663
+ return SCOPED_ABBR[name.toLowerCase()];
1664
+ }
1665
+ function replace_scoped(inlineTokens) {
1666
+ let inside_autolink = 0;
1667
+ for (let i = inlineTokens.length - 1; i >= 0; i--) {
1668
+ const token = inlineTokens[i];
1669
+ if (token.type === "text" && !inside_autolink) token.content = token.content.replace(SCOPED_ABBR_RE, replaceFn);
1670
+ if (token.type === "link_open" && token.info === "auto") inside_autolink--;
1671
+ if (token.type === "link_close" && token.info === "auto") inside_autolink++;
1672
+ }
1673
+ }
1674
+ function replace_rare(inlineTokens) {
1675
+ let inside_autolink = 0;
1676
+ for (let i = inlineTokens.length - 1; i >= 0; i--) {
1677
+ const token = inlineTokens[i];
1678
+ if (token.type === "text" && !inside_autolink) {
1679
+ if (RARE_RE.test(token.content)) token.content = token.content.replace(/\+-/g, "±").replace(/\.{2,}/g, "…").replace(/([?!])…/g, "$1..").replace(/([?!]){4,}/g, "$1$1$1").replace(/,{2,}/g, ",").replace(/(^|[^-])---(?=[^-]|$)/gm, "$1—").replace(/(^|\s)--(?=\s|$)/gm, "$1–").replace(/(^|[^-\s])--(?=[^-\s]|$)/gm, "$1–");
1680
+ }
1681
+ if (token.type === "link_open" && token.info === "auto") inside_autolink--;
1682
+ if (token.type === "link_close" && token.info === "auto") inside_autolink++;
1683
+ }
1684
+ }
1685
+ function replace(state) {
1686
+ let blkIdx;
1687
+ if (!state.md.options.typographer) return;
1688
+ for (blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
1689
+ if (state.tokens[blkIdx].type !== "inline") continue;
1690
+ if (SCOPED_ABBR_TEST_RE.test(state.tokens[blkIdx].content)) replace_scoped(state.tokens[blkIdx].children);
1691
+ if (RARE_RE.test(state.tokens[blkIdx].content)) replace_rare(state.tokens[blkIdx].children);
1692
+ }
1693
+ }
1694
+ //#endregion
1695
+ //#region src/rules_core/smartquotes.ts
1696
+ var QUOTE_TEST_RE = /['"]/;
1697
+ var QUOTE_RE = /['"]/g;
1698
+ var APOSTROPHE = "’";
1699
+ var MAX_OPENERS = 1e3;
1700
+ function truncateStack(stack, heads, length) {
1701
+ while (stack.length > length) {
1702
+ const item = stack.pop();
1703
+ if (item.isSingleQuote) heads.single = item.prevSameQuoteIdx;
1704
+ else heads.double = item.prevSameQuoteIdx;
1705
+ }
1706
+ }
1707
+ function addReplacement(replacements, tokenIdx, pos, ch) {
1708
+ if (!replacements[tokenIdx]) replacements[tokenIdx] = [];
1709
+ replacements[tokenIdx].push({
1710
+ pos,
1711
+ ch
1712
+ });
1713
+ }
1714
+ function applyReplacements(str, replacements) {
1715
+ let result = "";
1716
+ let lastPos = 0;
1717
+ replacements.sort((a, b) => a.pos - b.pos);
1718
+ for (let i = 0; i < replacements.length; i++) {
1719
+ const replacement = replacements[i];
1720
+ result += str.slice(lastPos, replacement.pos) + replacement.ch;
1721
+ lastPos = replacement.pos + 1;
1722
+ }
1723
+ return result + str.slice(lastPos);
1724
+ }
1725
+ function process_inlines(tokens, state) {
1726
+ let j;
1727
+ const stack = [];
1728
+ const heads = {
1729
+ single: -1,
1730
+ double: -1
1731
+ };
1732
+ const replacements = {};
1733
+ for (let i = 0; i < tokens.length; i++) {
1734
+ const token = tokens[i];
1735
+ const thisLevel = tokens[i].level;
1736
+ for (j = stack.length - 1; j >= 0; j--) if (stack[j].level <= thisLevel) break;
1737
+ truncateStack(stack, heads, j + 1);
1738
+ if (token.type !== "text") continue;
1739
+ const text = token.content;
1740
+ let pos = 0;
1741
+ const max = text.length;
1742
+ OUTER: while (pos < max) {
1743
+ QUOTE_RE.lastIndex = pos;
1744
+ const t = QUOTE_RE.exec(text);
1745
+ if (!t) break;
1746
+ let canOpen = true;
1747
+ let canClose = true;
1748
+ pos = t.index + 1;
1749
+ const isSingle = t[0] === "'";
1750
+ let lastChar = 32;
1751
+ if (t.index - 1 >= 0) lastChar = text.charCodeAt(t.index - 1);
1752
+ else for (j = i - 1; j >= 0; j--) {
1753
+ if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
1754
+ if (!tokens[j].content) continue;
1755
+ lastChar = tokens[j].content.charCodeAt(tokens[j].content.length - 1);
1756
+ break;
1757
+ }
1758
+ let nextChar = 32;
1759
+ if (pos < max) nextChar = text.charCodeAt(pos);
1760
+ else for (j = i + 1; j < tokens.length; j++) {
1761
+ if (tokens[j].type === "softbreak" || tokens[j].type === "hardbreak") break;
1762
+ if (!tokens[j].content) continue;
1763
+ nextChar = tokens[j].content.charCodeAt(0);
1764
+ break;
1765
+ }
1766
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
1767
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
1768
+ const isLastWhiteSpace = isWhiteSpace(lastChar);
1769
+ const isNextWhiteSpace = isWhiteSpace(nextChar);
1770
+ if (isNextWhiteSpace) canOpen = false;
1771
+ else if (isNextPunctChar) {
1772
+ if (!(isLastWhiteSpace || isLastPunctChar)) canOpen = false;
1773
+ }
1774
+ if (isLastWhiteSpace) canClose = false;
1775
+ else if (isLastPunctChar) {
1776
+ if (!(isNextWhiteSpace || isNextPunctChar)) canClose = false;
1777
+ }
1778
+ if (nextChar === 34 && t[0] === "\"") {
1779
+ if (lastChar >= 48 && lastChar <= 57) canClose = canOpen = false;
1780
+ }
1781
+ if (canOpen && canClose) {
1782
+ canOpen = isLastPunctChar;
1783
+ canClose = isNextPunctChar;
1784
+ }
1785
+ if (!canOpen && !canClose) {
1786
+ if (isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
1787
+ continue;
1788
+ }
1789
+ if (canClose) {
1790
+ j = isSingle ? heads.single : heads.double;
1791
+ if (j >= 0 && stack[j].level === thisLevel) {
1792
+ const item = stack[j];
1793
+ let openQuote;
1794
+ let closeQuote;
1795
+ if (isSingle) {
1796
+ openQuote = state.md.options.quotes[2];
1797
+ closeQuote = state.md.options.quotes[3];
1798
+ } else {
1799
+ openQuote = state.md.options.quotes[0];
1800
+ closeQuote = state.md.options.quotes[1];
1801
+ }
1802
+ addReplacement(replacements, i, t.index, closeQuote);
1803
+ addReplacement(replacements, item.tokenIdx, item.contentPos, openQuote);
1804
+ truncateStack(stack, heads, j);
1805
+ continue OUTER;
1806
+ }
1807
+ }
1808
+ if (canOpen) {
1809
+ if (stack.length >= MAX_OPENERS) return;
1810
+ stack.push({
1811
+ tokenIdx: i,
1812
+ contentPos: t.index,
1813
+ isSingleQuote: isSingle,
1814
+ level: thisLevel,
1815
+ prevSameQuoteIdx: isSingle ? heads.single : heads.double
1816
+ });
1817
+ if (isSingle) heads.single = stack.length - 1;
1818
+ else heads.double = stack.length - 1;
1819
+ } else if (canClose && isSingle) addReplacement(replacements, i, t.index, APOSTROPHE);
1820
+ }
1821
+ }
1822
+ Object.keys(replacements).forEach(function(tokenIdx) {
1823
+ const idx = Number(tokenIdx);
1824
+ tokens[idx].content = applyReplacements(tokens[idx].content, replacements[tokenIdx]);
1825
+ });
1826
+ }
1827
+ function smartquotes(state) {
1828
+ if (!state.md.options.typographer) return;
1829
+ for (let blkIdx = state.tokens.length - 1; blkIdx >= 0; blkIdx--) {
1830
+ if (state.tokens[blkIdx].type !== "inline" || !QUOTE_TEST_RE.test(state.tokens[blkIdx].content)) continue;
1831
+ process_inlines(state.tokens[blkIdx].children, state);
1832
+ }
1833
+ }
1834
+ //#endregion
1835
+ //#region src/rules_core/text_join.ts
1836
+ function join_alt(tokens) {
1837
+ let curr, last;
1838
+ const max = tokens.length;
1839
+ for (curr = 0; curr < max; curr++) if (tokens[curr].type === "text_special") tokens[curr].type = "text";
1840
+ for (curr = last = 0; curr < max; curr++) if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
1841
+ else {
1842
+ if (curr !== last) tokens[last] = tokens[curr];
1843
+ last++;
1844
+ }
1845
+ if (curr !== last) tokens.length = last;
1846
+ }
1847
+ function text_join(state) {
1848
+ let curr, last;
1849
+ const blockTokens = state.tokens;
1850
+ const l = blockTokens.length;
1851
+ for (let j = 0; j < l; j++) {
1852
+ if (blockTokens[j].type !== "inline") continue;
1853
+ const tokens = blockTokens[j].children;
1854
+ const max = tokens.length;
1855
+ for (curr = 0; curr < max; curr++) {
1856
+ if (tokens[curr].type === "text_special") tokens[curr].type = "text";
1857
+ if (tokens[curr].children) join_alt(tokens[curr].children);
1858
+ }
1859
+ for (curr = last = 0; curr < max; curr++) if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
1860
+ else {
1861
+ if (curr !== last) tokens[last] = tokens[curr];
1862
+ last++;
1863
+ }
1864
+ if (curr !== last) tokens.length = last;
1865
+ }
1866
+ }
1867
+ //#endregion
1868
+ //#region src/parser_core.ts
1869
+ var _rules$2 = [
1870
+ ["normalize", normalize],
1871
+ ["block", block],
1872
+ ["strip_references", strip_references],
1873
+ ["inline", inline],
1874
+ ["linkify", linkify$1],
1875
+ ["replacements", replace],
1876
+ ["smartquotes", smartquotes],
1877
+ ["text_join", text_join]
1878
+ ];
1879
+ /**
1880
+ * Top-level rules executor. Glues block/inline parsers and does intermediate
1881
+ * transformations.
1882
+ */
1883
+ var ParserCore = class {
1884
+ constructor() {
1885
+ _defineProperty(
1886
+ this,
1887
+ /**
1888
+ * {@link Ruler} instance. Keep configuration of core rules.
1889
+ */
1890
+ "ruler",
1891
+ new Ruler()
1892
+ );
1893
+ _defineProperty(this, "State", StateCore);
1894
+ for (let i = 0; i < _rules$2.length; i++) this.ruler.push(_rules$2[i][0], _rules$2[i][1]);
1895
+ }
1896
+ /**
1897
+ * Executes core chain rules.
1898
+ */
1899
+ process(state) {
1900
+ const rules = this.ruler.getRules("");
1901
+ for (let i = 0, l = rules.length; i < l; i++) rules[i](state);
1902
+ }
1903
+ };
1904
+ //#endregion
1905
+ //#region src/rules_block/state_block.ts
1906
+ /** Mutable state passed to block rules while tokenizing a source document. */
1907
+ var StateBlock = class {
1908
+ constructor(src, md, env, tokens) {
1909
+ _defineProperty(this, "bMarks", []);
1910
+ _defineProperty(this, "eMarks", []);
1911
+ _defineProperty(this, "tShift", []);
1912
+ _defineProperty(this, "sCount", []);
1913
+ _defineProperty(this, "bsCount", []);
1914
+ _defineProperty(this, "blkIndent", 0);
1915
+ _defineProperty(this, "line", 0);
1916
+ _defineProperty(this, "lineMax", 0);
1917
+ _defineProperty(this, "tight", false);
1918
+ _defineProperty(this, "listIndent", -1);
1919
+ _defineProperty(this, "parentType", "root");
1920
+ _defineProperty(this, "level", 0);
1921
+ _defineProperty(this, "Token", Token);
1922
+ this.src = src;
1923
+ this.md = md;
1924
+ this.env = env;
1925
+ this.tokens = tokens;
1926
+ const s = this.src;
1927
+ for (let start = 0, pos = 0, indent = 0, offset = 0, len = s.length, indent_found = false; pos < len; pos++) {
1928
+ const ch = s.charCodeAt(pos);
1929
+ if (!indent_found) if (isSpace(ch)) {
1930
+ indent++;
1931
+ if (ch === 9) offset += 4 - offset % 4;
1932
+ else offset++;
1933
+ continue;
1934
+ } else indent_found = true;
1935
+ if (ch === 10 || pos === len - 1) {
1936
+ if (ch !== 10) pos++;
1937
+ this.bMarks.push(start);
1938
+ this.eMarks.push(pos);
1939
+ this.tShift.push(indent);
1940
+ this.sCount.push(offset);
1941
+ this.bsCount.push(0);
1942
+ indent_found = false;
1943
+ indent = 0;
1944
+ offset = 0;
1945
+ start = pos + 1;
1946
+ }
1947
+ }
1948
+ this.bMarks.push(s.length);
1949
+ this.eMarks.push(s.length);
1950
+ this.tShift.push(0);
1951
+ this.sCount.push(0);
1952
+ this.bsCount.push(0);
1953
+ this.lineMax = this.bMarks.length - 1;
1954
+ }
1955
+ push(type, tag, nesting) {
1956
+ const token = new Token(type, tag, nesting);
1957
+ token.block = true;
1958
+ if (nesting < 0) this.level--;
1959
+ token.level = this.level;
1960
+ if (nesting > 0) this.level++;
1961
+ this.tokens.push(token);
1962
+ return token;
1963
+ }
1964
+ isEmpty(line) {
1965
+ return this.bMarks[line] + this.tShift[line] >= this.eMarks[line];
1966
+ }
1967
+ skipEmptyLines(from) {
1968
+ for (let max = this.lineMax; from < max; from++) if (this.bMarks[from] + this.tShift[from] < this.eMarks[from]) break;
1969
+ return from;
1970
+ }
1971
+ skipSpaces(pos) {
1972
+ for (let max = this.src.length; pos < max; pos++) if (!isSpace(this.src.charCodeAt(pos))) break;
1973
+ return pos;
1974
+ }
1975
+ skipSpacesBack(pos, min) {
1976
+ if (pos <= min) return pos;
1977
+ while (pos > min) if (!isSpace(this.src.charCodeAt(--pos))) return pos + 1;
1978
+ return pos;
1979
+ }
1980
+ skipChars(pos, code) {
1981
+ for (let max = this.src.length; pos < max; pos++) if (this.src.charCodeAt(pos) !== code) break;
1982
+ return pos;
1983
+ }
1984
+ skipCharsBack(pos, code, min) {
1985
+ if (pos <= min) return pos;
1986
+ while (pos > min) if (code !== this.src.charCodeAt(--pos)) return pos + 1;
1987
+ return pos;
1988
+ }
1989
+ getLines(begin, end, indent, keepLastLF) {
1990
+ if (begin >= end) return "";
1991
+ const queue = new Array(end - begin);
1992
+ for (let i = 0, line = begin; line < end; line++, i++) {
1993
+ let lineIndent = 0;
1994
+ const lineStart = this.bMarks[line];
1995
+ let first = lineStart;
1996
+ let last;
1997
+ if (line + 1 < end || keepLastLF) last = this.eMarks[line] + 1;
1998
+ else last = this.eMarks[line];
1999
+ while (first < last && lineIndent < indent) {
2000
+ const ch = this.src.charCodeAt(first);
2001
+ if (isSpace(ch)) if (ch === 9) lineIndent += 4 - (lineIndent + this.bsCount[line]) % 4;
2002
+ else lineIndent++;
2003
+ else if (first - lineStart < this.tShift[line]) lineIndent++;
2004
+ else break;
2005
+ first++;
2006
+ }
2007
+ if (lineIndent > indent) queue[i] = new Array(lineIndent - indent + 1).join(" ") + this.src.slice(first, last);
2008
+ else queue[i] = this.src.slice(first, last);
2009
+ }
2010
+ return queue.join("");
2011
+ }
2012
+ };
2013
+ //#endregion
2014
+ //#region src/rules_block/table.ts
2015
+ var MAX_AUTOCOMPLETED_CELLS = 65536;
2016
+ function getLine(state, line) {
2017
+ const pos = state.bMarks[line] + state.tShift[line];
2018
+ const max = state.eMarks[line];
2019
+ return state.src.slice(pos, max);
2020
+ }
2021
+ function escapedSplit(str) {
2022
+ const result = [];
2023
+ const max = str.length;
2024
+ let pos = 0;
2025
+ let ch = str.charCodeAt(pos);
2026
+ let isEscaped = false;
2027
+ let lastPos = 0;
2028
+ let current = "";
2029
+ while (pos < max) {
2030
+ if (ch === 124) if (!isEscaped) {
2031
+ result.push(current + str.substring(lastPos, pos));
2032
+ current = "";
2033
+ lastPos = pos + 1;
2034
+ } else {
2035
+ current += str.substring(lastPos, pos - 1);
2036
+ lastPos = pos;
2037
+ }
2038
+ isEscaped = ch === 92;
2039
+ pos++;
2040
+ ch = str.charCodeAt(pos);
2041
+ }
2042
+ result.push(current + str.substring(lastPos));
2043
+ return result;
2044
+ }
2045
+ function table(state, startLine, endLine, silent) {
2046
+ if (startLine + 2 > endLine) return false;
2047
+ let nextLine = startLine + 1;
2048
+ if (state.sCount[nextLine] < state.blkIndent) return false;
2049
+ if (state.sCount[nextLine] - state.blkIndent >= 4) return false;
2050
+ let pos = state.bMarks[nextLine] + state.tShift[nextLine];
2051
+ if (pos >= state.eMarks[nextLine]) return false;
2052
+ const firstCh = state.src.charCodeAt(pos++);
2053
+ if (firstCh !== 124 && firstCh !== 45 && firstCh !== 58) return false;
2054
+ if (pos >= state.eMarks[nextLine]) return false;
2055
+ const secondCh = state.src.charCodeAt(pos++);
2056
+ if (secondCh !== 124 && secondCh !== 45 && secondCh !== 58 && !isSpace(secondCh)) return false;
2057
+ if (firstCh === 45 && isSpace(secondCh)) return false;
2058
+ while (pos < state.eMarks[nextLine]) {
2059
+ const ch = state.src.charCodeAt(pos);
2060
+ if (ch !== 124 && ch !== 45 && ch !== 58 && !isSpace(ch)) return false;
2061
+ pos++;
2062
+ }
2063
+ let lineText = getLine(state, startLine + 1);
2064
+ let columns = lineText.split("|");
2065
+ const aligns = [];
2066
+ for (let i = 0; i < columns.length; i++) {
2067
+ const t = columns[i].trim();
2068
+ if (!t) if (i === 0 || i === columns.length - 1) continue;
2069
+ else return false;
2070
+ if (!/^:?-+:?$/.test(t)) return false;
2071
+ if (t.charCodeAt(t.length - 1) === 58) aligns.push(t.charCodeAt(0) === 58 ? "center" : "right");
2072
+ else if (t.charCodeAt(0) === 58) aligns.push("left");
2073
+ else aligns.push("");
2074
+ }
2075
+ lineText = getLine(state, startLine).trim();
2076
+ if (lineText.indexOf("|") === -1) return false;
2077
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2078
+ columns = escapedSplit(lineText);
2079
+ if (columns.length && columns[0] === "") columns.shift();
2080
+ if (columns.length && columns[columns.length - 1] === "") columns.pop();
2081
+ const columnCount = columns.length;
2082
+ if (columnCount === 0 || columnCount !== aligns.length) return false;
2083
+ if (silent) return true;
2084
+ const oldParentType = state.parentType;
2085
+ state.parentType = "table";
2086
+ const terminatorRules = state.md.block.ruler.getRules("blockquote");
2087
+ const token_to = state.push("table_open", "table", 1);
2088
+ const tableLines = [startLine, 0];
2089
+ token_to.map = tableLines;
2090
+ const token_tho = state.push("thead_open", "thead", 1);
2091
+ token_tho.map = [startLine, startLine + 1];
2092
+ const token_htro = state.push("tr_open", "tr", 1);
2093
+ token_htro.map = [startLine, startLine + 1];
2094
+ for (let i = 0; i < columns.length; i++) {
2095
+ const token_ho = state.push("th_open", "th", 1);
2096
+ if (aligns[i]) token_ho.attrs = [["style", `text-align:${aligns[i]}`]];
2097
+ const token_il = state.push("inline", "", 0);
2098
+ token_il.content = columns[i].trim();
2099
+ token_il.children = [];
2100
+ state.push("th_close", "th", -1);
2101
+ }
2102
+ state.push("tr_close", "tr", -1);
2103
+ state.push("thead_close", "thead", -1);
2104
+ let tbodyLines;
2105
+ let autocompletedCells = 0;
2106
+ for (nextLine = startLine + 2; nextLine < endLine; nextLine++) {
2107
+ if (state.sCount[nextLine] < state.blkIndent) break;
2108
+ let terminate = false;
2109
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2110
+ terminate = true;
2111
+ break;
2112
+ }
2113
+ if (terminate) break;
2114
+ lineText = getLine(state, nextLine).trim();
2115
+ if (!lineText) break;
2116
+ if (state.sCount[nextLine] - state.blkIndent >= 4) break;
2117
+ columns = escapedSplit(lineText);
2118
+ if (columns.length && columns[0] === "") columns.shift();
2119
+ if (columns.length && columns[columns.length - 1] === "") columns.pop();
2120
+ autocompletedCells += columnCount - columns.length;
2121
+ if (autocompletedCells > MAX_AUTOCOMPLETED_CELLS) break;
2122
+ if (nextLine === startLine + 2) {
2123
+ const token_tbo = state.push("tbody_open", "tbody", 1);
2124
+ token_tbo.map = tbodyLines = [startLine + 2, 0];
2125
+ }
2126
+ const token_tro = state.push("tr_open", "tr", 1);
2127
+ token_tro.map = [nextLine, nextLine + 1];
2128
+ for (let i = 0; i < columnCount; i++) {
2129
+ const token_tdo = state.push("td_open", "td", 1);
2130
+ if (aligns[i]) token_tdo.attrs = [["style", `text-align:${aligns[i]}`]];
2131
+ const token_il = state.push("inline", "", 0);
2132
+ token_il.content = columns[i] ? columns[i].trim() : "";
2133
+ token_il.children = [];
2134
+ state.push("td_close", "td", -1);
2135
+ }
2136
+ state.push("tr_close", "tr", -1);
2137
+ }
2138
+ if (tbodyLines) {
2139
+ state.push("tbody_close", "tbody", -1);
2140
+ tbodyLines[1] = nextLine;
2141
+ }
2142
+ state.push("table_close", "table", -1);
2143
+ tableLines[1] = nextLine;
2144
+ state.parentType = oldParentType;
2145
+ state.line = nextLine;
2146
+ return true;
2147
+ }
2148
+ //#endregion
2149
+ //#region src/rules_block/code.ts
2150
+ function code(state, startLine, endLine) {
2151
+ if (state.sCount[startLine] - state.blkIndent < 4) return false;
2152
+ let nextLine = startLine + 1;
2153
+ let last = nextLine;
2154
+ while (nextLine < endLine) {
2155
+ if (state.isEmpty(nextLine)) {
2156
+ nextLine++;
2157
+ continue;
2158
+ }
2159
+ if (state.sCount[nextLine] - state.blkIndent >= 4) {
2160
+ nextLine++;
2161
+ last = nextLine;
2162
+ continue;
2163
+ }
2164
+ break;
2165
+ }
2166
+ state.line = last;
2167
+ const token = state.push("code_block", "code", 0);
2168
+ token.content = state.getLines(startLine, last, 4 + state.blkIndent, false) + "\n";
2169
+ token.map = [startLine, state.line];
2170
+ return true;
2171
+ }
2172
+ //#endregion
2173
+ //#region src/rules_block/fence.ts
2174
+ function fence(state, startLine, endLine, silent) {
2175
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2176
+ let max = state.eMarks[startLine];
2177
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2178
+ if (pos + 3 > max) return false;
2179
+ const marker = state.src.charCodeAt(pos);
2180
+ if (marker !== 126 && marker !== 96) return false;
2181
+ let mem = pos;
2182
+ pos = state.skipChars(pos, marker);
2183
+ let len = pos - mem;
2184
+ if (len < 3) return false;
2185
+ const markup = state.src.slice(mem, pos);
2186
+ const params = state.src.slice(pos, max);
2187
+ if (marker === 96) {
2188
+ if (params.indexOf(String.fromCharCode(marker)) >= 0) return false;
2189
+ }
2190
+ if (silent) return true;
2191
+ let nextLine = startLine;
2192
+ let haveEndMarker = false;
2193
+ for (;;) {
2194
+ nextLine++;
2195
+ if (nextLine >= endLine) break;
2196
+ pos = mem = state.bMarks[nextLine] + state.tShift[nextLine];
2197
+ max = state.eMarks[nextLine];
2198
+ if (pos < max && state.sCount[nextLine] < state.blkIndent) break;
2199
+ if (state.src.charCodeAt(pos) !== marker) continue;
2200
+ if (state.sCount[nextLine] - state.blkIndent >= 4) continue;
2201
+ pos = state.skipChars(pos, marker);
2202
+ if (pos - mem < len) continue;
2203
+ pos = state.skipSpaces(pos);
2204
+ if (pos < max) continue;
2205
+ haveEndMarker = true;
2206
+ break;
2207
+ }
2208
+ len = state.sCount[startLine];
2209
+ state.line = nextLine + (haveEndMarker ? 1 : 0);
2210
+ const token = state.push("fence", "code", 0);
2211
+ token.info = params;
2212
+ token.content = state.getLines(startLine + 1, nextLine, len, true);
2213
+ token.markup = markup;
2214
+ token.map = [startLine, state.line];
2215
+ return true;
2216
+ }
2217
+ //#endregion
2218
+ //#region src/rules_block/blockquote.ts
2219
+ function blockquote(state, startLine, endLine, silent) {
2220
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2221
+ let max = state.eMarks[startLine];
2222
+ const oldLineMax = state.lineMax;
2223
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2224
+ if (state.src.charCodeAt(pos) !== 62) return false;
2225
+ if (silent) return true;
2226
+ const oldBMarks = [];
2227
+ const oldBSCount = [];
2228
+ const oldSCount = [];
2229
+ const oldTShift = [];
2230
+ const terminatorRules = state.md.block.ruler.getRules("blockquote");
2231
+ const oldParentType = state.parentType;
2232
+ state.parentType = "blockquote";
2233
+ let lastLineEmpty = false;
2234
+ let nextLine;
2235
+ for (nextLine = startLine; nextLine < endLine; nextLine++) {
2236
+ const isOutdented = state.sCount[nextLine] < state.blkIndent;
2237
+ pos = state.bMarks[nextLine] + state.tShift[nextLine];
2238
+ max = state.eMarks[nextLine];
2239
+ if (pos >= max) break;
2240
+ if (state.src.charCodeAt(pos++) === 62 && !isOutdented) {
2241
+ let initial = state.sCount[nextLine] + 1;
2242
+ let spaceAfterMarker;
2243
+ let adjustTab;
2244
+ if (state.src.charCodeAt(pos) === 32) {
2245
+ pos++;
2246
+ initial++;
2247
+ adjustTab = false;
2248
+ spaceAfterMarker = true;
2249
+ } else if (state.src.charCodeAt(pos) === 9) {
2250
+ spaceAfterMarker = true;
2251
+ if ((state.bsCount[nextLine] + initial) % 4 === 3) {
2252
+ pos++;
2253
+ initial++;
2254
+ adjustTab = false;
2255
+ } else adjustTab = true;
2256
+ } else spaceAfterMarker = false;
2257
+ let offset = initial;
2258
+ oldBMarks.push(state.bMarks[nextLine]);
2259
+ state.bMarks[nextLine] = pos;
2260
+ while (pos < max) {
2261
+ const ch = state.src.charCodeAt(pos);
2262
+ if (isSpace(ch)) if (ch === 9) offset += 4 - (offset + state.bsCount[nextLine] + (adjustTab ? 1 : 0)) % 4;
2263
+ else offset++;
2264
+ else break;
2265
+ pos++;
2266
+ }
2267
+ lastLineEmpty = pos >= max;
2268
+ oldBSCount.push(state.bsCount[nextLine]);
2269
+ state.bsCount[nextLine] = state.sCount[nextLine] + 1 + (spaceAfterMarker ? 1 : 0);
2270
+ oldSCount.push(state.sCount[nextLine]);
2271
+ state.sCount[nextLine] = offset - initial;
2272
+ oldTShift.push(state.tShift[nextLine]);
2273
+ state.tShift[nextLine] = pos - state.bMarks[nextLine];
2274
+ continue;
2275
+ }
2276
+ if (lastLineEmpty) break;
2277
+ let terminate = false;
2278
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2279
+ terminate = true;
2280
+ break;
2281
+ }
2282
+ if (terminate) {
2283
+ state.lineMax = nextLine;
2284
+ if (state.blkIndent !== 0) {
2285
+ oldBMarks.push(state.bMarks[nextLine]);
2286
+ oldBSCount.push(state.bsCount[nextLine]);
2287
+ oldTShift.push(state.tShift[nextLine]);
2288
+ oldSCount.push(state.sCount[nextLine]);
2289
+ state.sCount[nextLine] -= state.blkIndent;
2290
+ }
2291
+ break;
2292
+ }
2293
+ oldBMarks.push(state.bMarks[nextLine]);
2294
+ oldBSCount.push(state.bsCount[nextLine]);
2295
+ oldTShift.push(state.tShift[nextLine]);
2296
+ oldSCount.push(state.sCount[nextLine]);
2297
+ state.sCount[nextLine] = -1;
2298
+ }
2299
+ const oldIndent = state.blkIndent;
2300
+ state.blkIndent = 0;
2301
+ const token_o = state.push("blockquote_open", "blockquote", 1);
2302
+ token_o.markup = ">";
2303
+ const lines = [startLine, 0];
2304
+ token_o.map = lines;
2305
+ state.md.block.tokenize(state, startLine, nextLine);
2306
+ const token_c = state.push("blockquote_close", "blockquote", -1);
2307
+ token_c.markup = ">";
2308
+ state.lineMax = oldLineMax;
2309
+ state.parentType = oldParentType;
2310
+ lines[1] = state.line;
2311
+ for (let i = 0; i < oldTShift.length; i++) {
2312
+ state.bMarks[i + startLine] = oldBMarks[i];
2313
+ state.tShift[i + startLine] = oldTShift[i];
2314
+ state.sCount[i + startLine] = oldSCount[i];
2315
+ state.bsCount[i + startLine] = oldBSCount[i];
2316
+ }
2317
+ state.blkIndent = oldIndent;
2318
+ return true;
2319
+ }
2320
+ //#endregion
2321
+ //#region src/rules_block/hr.ts
2322
+ function hr(state, startLine, endLine, silent) {
2323
+ const max = state.eMarks[startLine];
2324
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2325
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2326
+ const marker = state.src.charCodeAt(pos++);
2327
+ if (marker !== 42 && marker !== 45 && marker !== 95) return false;
2328
+ let cnt = 1;
2329
+ while (pos < max) {
2330
+ const ch = state.src.charCodeAt(pos++);
2331
+ if (ch !== marker && !isSpace(ch)) return false;
2332
+ if (ch === marker) cnt++;
2333
+ }
2334
+ if (cnt < 3) return false;
2335
+ if (silent) return true;
2336
+ state.line = startLine + 1;
2337
+ const token = state.push("hr", "hr", 0);
2338
+ token.map = [startLine, state.line];
2339
+ token.markup = Array(cnt + 1).join(String.fromCharCode(marker));
2340
+ return true;
2341
+ }
2342
+ //#endregion
2343
+ //#region src/rules_block/list.ts
2344
+ function skipBulletListMarker(state, startLine) {
2345
+ const max = state.eMarks[startLine];
2346
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2347
+ const marker = state.src.charCodeAt(pos++);
2348
+ if (marker !== 42 && marker !== 45 && marker !== 43) return -1;
2349
+ if (pos < max) {
2350
+ if (!isSpace(state.src.charCodeAt(pos))) return -1;
2351
+ }
2352
+ return pos;
2353
+ }
2354
+ function skipOrderedListMarker(state, startLine) {
2355
+ const start = state.bMarks[startLine] + state.tShift[startLine];
2356
+ const max = state.eMarks[startLine];
2357
+ let pos = start;
2358
+ if (pos + 1 >= max) return -1;
2359
+ let ch = state.src.charCodeAt(pos++);
2360
+ if (ch < 48 || ch > 57) return -1;
2361
+ for (;;) {
2362
+ if (pos >= max) return -1;
2363
+ ch = state.src.charCodeAt(pos++);
2364
+ if (ch >= 48 && ch <= 57) {
2365
+ if (pos - start >= 10) return -1;
2366
+ continue;
2367
+ }
2368
+ if (ch === 41 || ch === 46) break;
2369
+ return -1;
2370
+ }
2371
+ if (pos < max) {
2372
+ ch = state.src.charCodeAt(pos);
2373
+ if (!isSpace(ch)) return -1;
2374
+ }
2375
+ return pos;
2376
+ }
2377
+ function markTightParagraphs(state, idx) {
2378
+ const level = state.level + 2;
2379
+ for (let i = idx + 2, l = state.tokens.length - 2; i < l; i++) if (state.tokens[i].level === level && state.tokens[i].type === "paragraph_open") {
2380
+ state.tokens[i + 2].hidden = true;
2381
+ state.tokens[i].hidden = true;
2382
+ i += 2;
2383
+ }
2384
+ }
2385
+ function list(state, startLine, endLine, silent) {
2386
+ let max, pos, start, token;
2387
+ let nextLine = startLine;
2388
+ let tight = true;
2389
+ if (state.sCount[nextLine] - state.blkIndent >= 4) return false;
2390
+ if (state.listIndent >= 0 && state.sCount[nextLine] - state.listIndent >= 4 && state.sCount[nextLine] < state.blkIndent) return false;
2391
+ let isTerminatingParagraph = false;
2392
+ if (silent && state.parentType === "paragraph") {
2393
+ if (state.sCount[nextLine] >= state.blkIndent) isTerminatingParagraph = true;
2394
+ }
2395
+ let isOrdered;
2396
+ let markerValue;
2397
+ let posAfterMarker;
2398
+ if ((posAfterMarker = skipOrderedListMarker(state, nextLine)) >= 0) {
2399
+ isOrdered = true;
2400
+ start = state.bMarks[nextLine] + state.tShift[nextLine];
2401
+ markerValue = Number(state.src.slice(start, posAfterMarker - 1));
2402
+ if (isTerminatingParagraph && markerValue !== 1) return false;
2403
+ } else if ((posAfterMarker = skipBulletListMarker(state, nextLine)) >= 0) isOrdered = false;
2404
+ else return false;
2405
+ if (isTerminatingParagraph) {
2406
+ if (state.skipSpaces(posAfterMarker) >= state.eMarks[nextLine]) return false;
2407
+ }
2408
+ if (silent) return true;
2409
+ const markerCharCode = state.src.charCodeAt(posAfterMarker - 1);
2410
+ const listTokIdx = state.tokens.length;
2411
+ if (isOrdered) {
2412
+ token = state.push("ordered_list_open", "ol", 1);
2413
+ if (markerValue !== 1) token.attrs = [["start", markerValue]];
2414
+ } else token = state.push("bullet_list_open", "ul", 1);
2415
+ const listLines = [nextLine, 0];
2416
+ token.map = listLines;
2417
+ token.markup = String.fromCharCode(markerCharCode);
2418
+ let prevEmptyEnd = false;
2419
+ const terminatorRules = state.md.block.ruler.getRules("list");
2420
+ const oldParentType = state.parentType;
2421
+ state.parentType = "list";
2422
+ while (nextLine < endLine) {
2423
+ pos = posAfterMarker;
2424
+ max = state.eMarks[nextLine];
2425
+ const initial = state.sCount[nextLine] + posAfterMarker - (state.bMarks[nextLine] + state.tShift[nextLine]);
2426
+ let offset = initial;
2427
+ while (pos < max) {
2428
+ const ch = state.src.charCodeAt(pos);
2429
+ if (ch === 9) offset += 4 - (offset + state.bsCount[nextLine]) % 4;
2430
+ else if (ch === 32) offset++;
2431
+ else break;
2432
+ pos++;
2433
+ }
2434
+ const contentStart = pos;
2435
+ let indentAfterMarker;
2436
+ if (contentStart >= max) indentAfterMarker = 1;
2437
+ else indentAfterMarker = offset - initial;
2438
+ if (indentAfterMarker > 4) indentAfterMarker = 1;
2439
+ const indent = initial + indentAfterMarker;
2440
+ token = state.push("list_item_open", "li", 1);
2441
+ token.markup = String.fromCharCode(markerCharCode);
2442
+ const itemLines = [nextLine, 0];
2443
+ token.map = itemLines;
2444
+ if (isOrdered) token.info = state.src.slice(start, posAfterMarker - 1);
2445
+ const oldTight = state.tight;
2446
+ const oldTShift = state.tShift[nextLine];
2447
+ const oldSCount = state.sCount[nextLine];
2448
+ const oldListIndent = state.listIndent;
2449
+ state.listIndent = state.blkIndent;
2450
+ state.blkIndent = indent;
2451
+ state.tight = true;
2452
+ state.tShift[nextLine] = contentStart - state.bMarks[nextLine];
2453
+ state.sCount[nextLine] = offset;
2454
+ if (contentStart >= max && state.isEmpty(nextLine + 1)) state.line = Math.min(state.line + 2, endLine);
2455
+ else state.md.block.tokenize(state, nextLine, endLine);
2456
+ if (!state.tight || prevEmptyEnd) tight = false;
2457
+ prevEmptyEnd = state.line - nextLine > 1 && state.isEmpty(state.line - 1);
2458
+ state.blkIndent = state.listIndent;
2459
+ state.listIndent = oldListIndent;
2460
+ state.tShift[nextLine] = oldTShift;
2461
+ state.sCount[nextLine] = oldSCount;
2462
+ state.tight = oldTight;
2463
+ token = state.push("list_item_close", "li", -1);
2464
+ token.markup = String.fromCharCode(markerCharCode);
2465
+ nextLine = state.line;
2466
+ itemLines[1] = nextLine;
2467
+ if (nextLine >= endLine) break;
2468
+ if (state.sCount[nextLine] < state.blkIndent) break;
2469
+ if (state.sCount[nextLine] - state.blkIndent >= 4) break;
2470
+ let terminate = false;
2471
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2472
+ terminate = true;
2473
+ break;
2474
+ }
2475
+ if (terminate) break;
2476
+ if (isOrdered) {
2477
+ posAfterMarker = skipOrderedListMarker(state, nextLine);
2478
+ if (posAfterMarker < 0) break;
2479
+ start = state.bMarks[nextLine] + state.tShift[nextLine];
2480
+ } else {
2481
+ posAfterMarker = skipBulletListMarker(state, nextLine);
2482
+ if (posAfterMarker < 0) break;
2483
+ }
2484
+ if (markerCharCode !== state.src.charCodeAt(posAfterMarker - 1)) break;
2485
+ }
2486
+ if (isOrdered) token = state.push("ordered_list_close", "ol", -1);
2487
+ else token = state.push("bullet_list_close", "ul", -1);
2488
+ token.markup = String.fromCharCode(markerCharCode);
2489
+ listLines[1] = nextLine;
2490
+ state.line = nextLine;
2491
+ state.parentType = oldParentType;
2492
+ if (tight) markTightParagraphs(state, listTokIdx);
2493
+ return true;
2494
+ }
2495
+ //#endregion
2496
+ //#region src/rules_block/reference.ts
2497
+ function reference(state, startLine, _endLine, silent) {
2498
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2499
+ let max = state.eMarks[startLine];
2500
+ let nextLine = startLine + 1;
2501
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2502
+ if (state.src.charCodeAt(pos) !== 91) return false;
2503
+ function getNextLine(nextLine) {
2504
+ const endLine = state.lineMax;
2505
+ if (nextLine >= endLine || state.isEmpty(nextLine)) return null;
2506
+ let isContinuation = false;
2507
+ if (state.sCount[nextLine] - state.blkIndent > 3) isContinuation = true;
2508
+ if (state.sCount[nextLine] < 0) isContinuation = true;
2509
+ if (!isContinuation) {
2510
+ const terminatorRules = state.md.block.ruler.getRules("reference");
2511
+ const oldParentType = state.parentType;
2512
+ state.parentType = "reference";
2513
+ let terminate = false;
2514
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2515
+ terminate = true;
2516
+ break;
2517
+ }
2518
+ state.parentType = oldParentType;
2519
+ if (terminate) return null;
2520
+ }
2521
+ const pos = state.bMarks[nextLine] + state.tShift[nextLine];
2522
+ const max = state.eMarks[nextLine];
2523
+ return state.src.slice(pos, max + 1);
2524
+ }
2525
+ let str = state.src.slice(pos, max + 1);
2526
+ max = str.length;
2527
+ let labelEnd = -1;
2528
+ for (pos = 1; pos < max; pos++) {
2529
+ const ch = str.charCodeAt(pos);
2530
+ if (ch === 91) return false;
2531
+ else if (ch === 93) {
2532
+ labelEnd = pos;
2533
+ break;
2534
+ } else if (ch === 10) {
2535
+ const lineContent = getNextLine(nextLine);
2536
+ if (lineContent !== null) {
2537
+ str += lineContent;
2538
+ max = str.length;
2539
+ nextLine++;
2540
+ }
2541
+ } else if (ch === 92) {
2542
+ pos++;
2543
+ if (pos < max && str.charCodeAt(pos) === 10) {
2544
+ const lineContent = getNextLine(nextLine);
2545
+ if (lineContent !== null) {
2546
+ str += lineContent;
2547
+ max = str.length;
2548
+ nextLine++;
2549
+ }
2550
+ }
2551
+ }
2552
+ }
2553
+ if (labelEnd < 0 || str.charCodeAt(labelEnd + 1) !== 58) return false;
2554
+ for (pos = labelEnd + 2; pos < max; pos++) {
2555
+ const ch = str.charCodeAt(pos);
2556
+ if (ch === 10) {
2557
+ const lineContent = getNextLine(nextLine);
2558
+ if (lineContent !== null) {
2559
+ str += lineContent;
2560
+ max = str.length;
2561
+ nextLine++;
2562
+ }
2563
+ } else if (isSpace(ch)) {} else break;
2564
+ }
2565
+ const destRes = state.md.helpers.parseLinkDestination(str, pos, max);
2566
+ if (!destRes.ok) return false;
2567
+ const href = state.md.normalizeLink(destRes.str);
2568
+ if (!state.md.validateLink(href)) return false;
2569
+ pos = destRes.pos;
2570
+ const destEndPos = pos;
2571
+ const destEndLineNo = nextLine;
2572
+ const start = pos;
2573
+ for (; pos < max; pos++) {
2574
+ const ch = str.charCodeAt(pos);
2575
+ if (ch === 10) {
2576
+ const lineContent = getNextLine(nextLine);
2577
+ if (lineContent !== null) {
2578
+ str += lineContent;
2579
+ max = str.length;
2580
+ nextLine++;
2581
+ }
2582
+ } else if (isSpace(ch)) {} else break;
2583
+ }
2584
+ let titleRes = state.md.helpers.parseLinkTitle(str, pos, max);
2585
+ while (titleRes.can_continue) {
2586
+ const lineContent = getNextLine(nextLine);
2587
+ if (lineContent === null) break;
2588
+ str += lineContent;
2589
+ pos = max;
2590
+ max = str.length;
2591
+ nextLine++;
2592
+ titleRes = state.md.helpers.parseLinkTitle(str, pos, max, titleRes);
2593
+ }
2594
+ let title;
2595
+ if (pos < max && start !== pos && titleRes.ok) {
2596
+ title = titleRes.str;
2597
+ pos = titleRes.pos;
2598
+ } else {
2599
+ title = "";
2600
+ pos = destEndPos;
2601
+ nextLine = destEndLineNo;
2602
+ }
2603
+ while (pos < max) {
2604
+ if (!isSpace(str.charCodeAt(pos))) break;
2605
+ pos++;
2606
+ }
2607
+ if (pos < max && str.charCodeAt(pos) !== 10) {
2608
+ if (title) {
2609
+ title = "";
2610
+ pos = destEndPos;
2611
+ nextLine = destEndLineNo;
2612
+ while (pos < max) {
2613
+ if (!isSpace(str.charCodeAt(pos))) break;
2614
+ pos++;
2615
+ }
2616
+ }
2617
+ }
2618
+ if (pos < max && str.charCodeAt(pos) !== 10) return false;
2619
+ const label = normalizeReference(str.slice(1, labelEnd));
2620
+ if (!label) return false;
2621
+ /* istanbul ignore if */
2622
+ if (silent) return true;
2623
+ if (typeof state.env.references === "undefined") state.env.references = {};
2624
+ if (typeof state.env.references[label] === "undefined") state.env.references[label] = {
2625
+ title,
2626
+ href
2627
+ };
2628
+ const token = state.push("reference_definition", "", 0);
2629
+ token.map = [startLine, nextLine];
2630
+ token.hidden = true;
2631
+ const meta = Object.create(null);
2632
+ meta.label = label;
2633
+ token.meta = meta;
2634
+ state.line = nextLine;
2635
+ return true;
2636
+ }
2637
+ //#endregion
2638
+ //#region src/common/html_blocks.ts
2639
+ var html_blocks_default = [
2640
+ "address",
2641
+ "article",
2642
+ "aside",
2643
+ "base",
2644
+ "basefont",
2645
+ "blockquote",
2646
+ "body",
2647
+ "caption",
2648
+ "center",
2649
+ "col",
2650
+ "colgroup",
2651
+ "dd",
2652
+ "details",
2653
+ "dialog",
2654
+ "dir",
2655
+ "div",
2656
+ "dl",
2657
+ "dt",
2658
+ "fieldset",
2659
+ "figcaption",
2660
+ "figure",
2661
+ "footer",
2662
+ "form",
2663
+ "frame",
2664
+ "frameset",
2665
+ "h1",
2666
+ "h2",
2667
+ "h3",
2668
+ "h4",
2669
+ "h5",
2670
+ "h6",
2671
+ "head",
2672
+ "header",
2673
+ "hr",
2674
+ "html",
2675
+ "iframe",
2676
+ "legend",
2677
+ "li",
2678
+ "link",
2679
+ "main",
2680
+ "menu",
2681
+ "menuitem",
2682
+ "nav",
2683
+ "noframes",
2684
+ "ol",
2685
+ "optgroup",
2686
+ "option",
2687
+ "p",
2688
+ "param",
2689
+ "search",
2690
+ "section",
2691
+ "summary",
2692
+ "table",
2693
+ "tbody",
2694
+ "td",
2695
+ "tfoot",
2696
+ "th",
2697
+ "thead",
2698
+ "title",
2699
+ "tr",
2700
+ "track",
2701
+ "ul"
2702
+ ];
2703
+ //#endregion
2704
+ //#region src/common/html_re.ts
2705
+ var open_tag = `<[A-Za-z][A-Za-z0-9\\-]*(?:\\s+[a-zA-Z_:][a-zA-Z0-9:._-]*(?:\\s*=\\s*(?:[^"'=<>\`\\x00-\\x20]+|'[^']*'|"[^"]*"))?)*\\s*\\/?>`;
2706
+ var close_tag = "<\\/[A-Za-z][A-Za-z0-9\\-]*\\s*>";
2707
+ var HTML_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag}|<!---?>|<!--(?:[^-]|-[^-]|--[^>])*-->|<[?][\\s\\S]*?[?]>|<![A-Za-z][^>]*>|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>)`);
2708
+ var HTML_OPEN_CLOSE_TAG_RE = new RegExp(`^(?:${open_tag}|${close_tag})`);
2709
+ //#endregion
2710
+ //#region src/rules_block/html_block.ts
2711
+ var HTML_SEQUENCES = [
2712
+ [
2713
+ /^<(script|pre|style|textarea)(?=(\s|>|$))/i,
2714
+ /<\/(script|pre|style|textarea)>/i,
2715
+ true
2716
+ ],
2717
+ [
2718
+ /^<!--/,
2719
+ /-->/,
2720
+ true
2721
+ ],
2722
+ [
2723
+ /^<\?/,
2724
+ /\?>/,
2725
+ true
2726
+ ],
2727
+ [
2728
+ /^<![A-Za-z]/,
2729
+ />/,
2730
+ true
2731
+ ],
2732
+ [
2733
+ /^<!\[CDATA\[/,
2734
+ /\]\]>/,
2735
+ true
2736
+ ],
2737
+ [
2738
+ new RegExp(`^</?(${html_blocks_default.join("|")})(?=(\\s|/?>|$))`, "i"),
2739
+ /^$/,
2740
+ true
2741
+ ],
2742
+ [
2743
+ new RegExp(`${HTML_OPEN_CLOSE_TAG_RE.source}\\s*$`),
2744
+ /^$/,
2745
+ false
2746
+ ]
2747
+ ];
2748
+ function html_block(state, startLine, endLine, silent) {
2749
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2750
+ let max = state.eMarks[startLine];
2751
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2752
+ if (!state.md.options.html) return false;
2753
+ if (state.src.charCodeAt(pos) !== 60) return false;
2754
+ let lineText = state.src.slice(pos, max);
2755
+ let i = 0;
2756
+ for (; i < HTML_SEQUENCES.length; i++) if (HTML_SEQUENCES[i][0].test(lineText)) break;
2757
+ if (i === HTML_SEQUENCES.length) return false;
2758
+ if (silent) return HTML_SEQUENCES[i][2];
2759
+ let nextLine = startLine + 1;
2760
+ const endsOnBlankLine = HTML_SEQUENCES[i][1].test("");
2761
+ if (!HTML_SEQUENCES[i][1].test(lineText)) for (; nextLine < endLine; nextLine++) {
2762
+ if (state.sCount[nextLine] < state.blkIndent) {
2763
+ if (endsOnBlankLine || !state.isEmpty(nextLine)) break;
2764
+ }
2765
+ pos = state.bMarks[nextLine] + state.tShift[nextLine];
2766
+ max = state.eMarks[nextLine];
2767
+ lineText = state.src.slice(pos, max);
2768
+ if (HTML_SEQUENCES[i][1].test(lineText)) {
2769
+ if (lineText.length !== 0) nextLine++;
2770
+ break;
2771
+ }
2772
+ }
2773
+ state.line = nextLine;
2774
+ const token = state.push("html_block", "", 0);
2775
+ token.map = [startLine, nextLine];
2776
+ token.content = state.getLines(startLine, nextLine, state.blkIndent, true);
2777
+ return true;
2778
+ }
2779
+ //#endregion
2780
+ //#region src/rules_block/heading.ts
2781
+ function heading(state, startLine, endLine, silent) {
2782
+ let pos = state.bMarks[startLine] + state.tShift[startLine];
2783
+ let max = state.eMarks[startLine];
2784
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2785
+ let ch = state.src.charCodeAt(pos);
2786
+ if (ch !== 35 || pos >= max) return false;
2787
+ let level = 1;
2788
+ ch = state.src.charCodeAt(++pos);
2789
+ while (ch === 35 && pos < max && level <= 6) {
2790
+ level++;
2791
+ ch = state.src.charCodeAt(++pos);
2792
+ }
2793
+ if (level > 6 || pos < max && !isSpace(ch)) return false;
2794
+ if (silent) return true;
2795
+ max = state.skipSpacesBack(max, pos);
2796
+ const tmp = state.skipCharsBack(max, 35, pos);
2797
+ if (tmp > pos && isSpace(state.src.charCodeAt(tmp - 1))) max = tmp;
2798
+ state.line = startLine + 1;
2799
+ const token_o = state.push("heading_open", `h${level}`, 1);
2800
+ token_o.markup = "########".slice(0, level);
2801
+ token_o.map = [startLine, state.line];
2802
+ const token_i = state.push("inline", "", 0);
2803
+ token_i.content = asciiTrim(state.src.slice(pos, max));
2804
+ token_i.map = [startLine, state.line];
2805
+ token_i.children = [];
2806
+ const token_c = state.push("heading_close", `h${level}`, -1);
2807
+ token_c.markup = "########".slice(0, level);
2808
+ return true;
2809
+ }
2810
+ //#endregion
2811
+ //#region src/rules_block/lheading.ts
2812
+ function lheading(state, startLine, endLine) {
2813
+ const terminatorRules = state.md.block.ruler.getRules("paragraph");
2814
+ if (state.sCount[startLine] - state.blkIndent >= 4) return false;
2815
+ const oldParentType = state.parentType;
2816
+ state.parentType = "paragraph";
2817
+ let level = 0;
2818
+ let marker;
2819
+ let nextLine = startLine + 1;
2820
+ for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2821
+ if (state.sCount[nextLine] - state.blkIndent > 3) continue;
2822
+ if (state.sCount[nextLine] >= state.blkIndent) {
2823
+ let pos = state.bMarks[nextLine] + state.tShift[nextLine];
2824
+ const max = state.eMarks[nextLine];
2825
+ if (pos < max) {
2826
+ marker = state.src.charCodeAt(pos);
2827
+ if (marker === 45 || marker === 61) {
2828
+ pos = state.skipChars(pos, marker);
2829
+ pos = state.skipSpaces(pos);
2830
+ if (pos >= max) {
2831
+ level = marker === 61 ? 1 : 2;
2832
+ break;
2833
+ }
2834
+ }
2835
+ }
2836
+ }
2837
+ if (state.sCount[nextLine] < 0) continue;
2838
+ let terminate = false;
2839
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2840
+ terminate = true;
2841
+ break;
2842
+ }
2843
+ if (terminate) break;
2844
+ }
2845
+ if (!level) {
2846
+ state.parentType = oldParentType;
2847
+ return false;
2848
+ }
2849
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
2850
+ state.line = nextLine + 1;
2851
+ const token_o = state.push("heading_open", `h${level}`, 1);
2852
+ token_o.markup = String.fromCharCode(marker);
2853
+ token_o.map = [startLine, state.line];
2854
+ const token_i = state.push("inline", "", 0);
2855
+ token_i.content = content;
2856
+ token_i.map = [startLine, state.line - 1];
2857
+ token_i.children = [];
2858
+ const token_c = state.push("heading_close", `h${level}`, -1);
2859
+ token_c.markup = String.fromCharCode(marker);
2860
+ state.parentType = oldParentType;
2861
+ return true;
2862
+ }
2863
+ //#endregion
2864
+ //#region src/rules_block/paragraph.ts
2865
+ function paragraph(state, startLine, endLine) {
2866
+ const terminatorRules = state.md.block.ruler.getRules("paragraph");
2867
+ const oldParentType = state.parentType;
2868
+ let nextLine = startLine + 1;
2869
+ state.parentType = "paragraph";
2870
+ for (; nextLine < endLine && !state.isEmpty(nextLine); nextLine++) {
2871
+ if (state.sCount[nextLine] - state.blkIndent > 3) continue;
2872
+ if (state.sCount[nextLine] < 0) continue;
2873
+ let terminate = false;
2874
+ for (let i = 0, l = terminatorRules.length; i < l; i++) if (terminatorRules[i](state, nextLine, endLine, true)) {
2875
+ terminate = true;
2876
+ break;
2877
+ }
2878
+ if (terminate) break;
2879
+ }
2880
+ const content = asciiTrim(state.getLines(startLine, nextLine, state.blkIndent, false));
2881
+ state.line = nextLine;
2882
+ const token_o = state.push("paragraph_open", "p", 1);
2883
+ token_o.map = [startLine, state.line];
2884
+ const token_i = state.push("inline", "", 0);
2885
+ token_i.content = content;
2886
+ token_i.map = [startLine, state.line];
2887
+ token_i.children = [];
2888
+ state.push("paragraph_close", "p", -1);
2889
+ state.parentType = oldParentType;
2890
+ return true;
2891
+ }
2892
+ //#endregion
2893
+ //#region src/parser_block.ts
2894
+ var _rules$1 = [
2895
+ [
2896
+ "table",
2897
+ table,
2898
+ ["paragraph", "reference"]
2899
+ ],
2900
+ ["code", code],
2901
+ [
2902
+ "fence",
2903
+ fence,
2904
+ [
2905
+ "paragraph",
2906
+ "reference",
2907
+ "blockquote",
2908
+ "list"
2909
+ ]
2910
+ ],
2911
+ [
2912
+ "blockquote",
2913
+ blockquote,
2914
+ [
2915
+ "paragraph",
2916
+ "reference",
2917
+ "blockquote",
2918
+ "list"
2919
+ ]
2920
+ ],
2921
+ [
2922
+ "hr",
2923
+ hr,
2924
+ [
2925
+ "paragraph",
2926
+ "reference",
2927
+ "blockquote",
2928
+ "list"
2929
+ ]
2930
+ ],
2931
+ [
2932
+ "list",
2933
+ list,
2934
+ [
2935
+ "paragraph",
2936
+ "reference",
2937
+ "blockquote"
2938
+ ]
2939
+ ],
2940
+ ["reference", reference],
2941
+ [
2942
+ "html_block",
2943
+ html_block,
2944
+ [
2945
+ "paragraph",
2946
+ "reference",
2947
+ "blockquote"
2948
+ ]
2949
+ ],
2950
+ [
2951
+ "heading",
2952
+ heading,
2953
+ [
2954
+ "paragraph",
2955
+ "reference",
2956
+ "blockquote"
2957
+ ]
2958
+ ],
2959
+ ["lheading", lheading],
2960
+ ["paragraph", paragraph]
2961
+ ];
2962
+ /**
2963
+ * Block-level tokenizer.
2964
+ */
2965
+ var ParserBlock = class {
2966
+ constructor() {
2967
+ _defineProperty(
2968
+ this,
2969
+ /**
2970
+ * {@link Ruler} instance. Keep configuration of block rules.
2971
+ */
2972
+ "ruler",
2973
+ new Ruler()
2974
+ );
2975
+ _defineProperty(this, "State", StateBlock);
2976
+ for (let i = 0; i < _rules$1.length; i++) this.ruler.push(_rules$1[i][0], _rules$1[i][1], { alt: (_rules$1[i][2] || []).slice() });
2977
+ }
2978
+ tokenize(state, startLine, endLine) {
2979
+ const rules = this.ruler.getRules("");
2980
+ const len = rules.length;
2981
+ const maxNesting = state.md.options.maxNesting;
2982
+ let line = startLine;
2983
+ let hasEmptyLines = false;
2984
+ while (line < endLine) {
2985
+ state.line = line = state.skipEmptyLines(line);
2986
+ if (line >= endLine) break;
2987
+ if (state.sCount[line] < state.blkIndent) break;
2988
+ if (state.level >= maxNesting) {
2989
+ state.line = endLine;
2990
+ break;
2991
+ }
2992
+ const prevLine = state.line;
2993
+ let ok = false;
2994
+ for (let i = 0; i < len; i++) {
2995
+ ok = rules[i](state, line, endLine, false);
2996
+ if (ok) {
2997
+ if (prevLine >= state.line) throw new Error("block rule didn't increment state.line");
2998
+ break;
2999
+ }
3000
+ }
3001
+ if (!ok) throw new Error("none of the block rules matched");
3002
+ state.tight = !hasEmptyLines;
3003
+ if (state.isEmpty(state.line - 1)) hasEmptyLines = true;
3004
+ line = state.line;
3005
+ if (line < endLine && state.isEmpty(line)) {
3006
+ hasEmptyLines = true;
3007
+ line++;
3008
+ state.line = line;
3009
+ }
3010
+ }
3011
+ }
3012
+ /**
3013
+ * Process input string and push block tokens into `outTokens`
3014
+ */
3015
+ parse(src, md, env, outTokens) {
3016
+ if (!src) return;
3017
+ const state = new this.State(src, md, env, outTokens);
3018
+ this.tokenize(state, state.line, state.lineMax);
3019
+ }
3020
+ };
3021
+ //#endregion
3022
+ //#region src/rules_inline/state_inline.ts
3023
+ /** Mutable state passed to inline rules while tokenizing inline content. */
3024
+ var StateInline = class {
3025
+ constructor(src, md, env, outTokens) {
3026
+ _defineProperty(this, "pos", 0);
3027
+ _defineProperty(this, "level", 0);
3028
+ _defineProperty(this, "pending", "");
3029
+ _defineProperty(this, "pendingLevel", 0);
3030
+ _defineProperty(this, "cache", {});
3031
+ _defineProperty(this, "backticks", {});
3032
+ _defineProperty(this, "backticksScanned", false);
3033
+ _defineProperty(this, "linkLevel", 0);
3034
+ _defineProperty(this, "delimiters", []);
3035
+ _defineProperty(this, "_prev_delimiters", []);
3036
+ _defineProperty(this, "Token", Token);
3037
+ this.src = src;
3038
+ this.env = env;
3039
+ this.md = md;
3040
+ this.tokens = outTokens;
3041
+ this.tokens_meta = Array(outTokens.length);
3042
+ this.posMax = this.src.length;
3043
+ }
3044
+ pushPending() {
3045
+ const token = new Token("text", "", 0);
3046
+ token.content = this.pending;
3047
+ token.level = this.pendingLevel;
3048
+ this.tokens.push(token);
3049
+ this.pending = "";
3050
+ return token;
3051
+ }
3052
+ push(type, tag, nesting) {
3053
+ if (this.pending) this.pushPending();
3054
+ const token = new Token(type, tag, nesting);
3055
+ let token_meta = void 0;
3056
+ if (nesting < 0) {
3057
+ this.level--;
3058
+ this.delimiters = this._prev_delimiters.pop();
3059
+ }
3060
+ token.level = this.level;
3061
+ if (nesting > 0) {
3062
+ this.level++;
3063
+ this._prev_delimiters.push(this.delimiters);
3064
+ this.delimiters = [];
3065
+ token_meta = { delimiters: this.delimiters };
3066
+ }
3067
+ this.pendingLevel = this.level;
3068
+ this.tokens.push(token);
3069
+ this.tokens_meta.push(token_meta);
3070
+ return token;
3071
+ }
3072
+ scanDelims(start, canSplitWord) {
3073
+ const max = this.posMax;
3074
+ const marker = this.src.charCodeAt(start);
3075
+ let lastChar;
3076
+ if (start === 0) lastChar = 32;
3077
+ else if (start === 1) {
3078
+ lastChar = this.src.charCodeAt(0);
3079
+ if ((lastChar & 63488) === 55296) lastChar = 65533;
3080
+ } else {
3081
+ lastChar = this.src.charCodeAt(start - 1);
3082
+ if ((lastChar & 64512) === 56320) {
3083
+ const highSurr = this.src.charCodeAt(start - 2);
3084
+ lastChar = (highSurr & 64512) === 55296 ? 65536 + (highSurr - 55296 << 10) + (lastChar - 56320) : 65533;
3085
+ } else if ((lastChar & 64512) === 55296) lastChar = 65533;
3086
+ }
3087
+ let pos = start;
3088
+ while (pos < max && this.src.charCodeAt(pos) === marker) pos++;
3089
+ const count = pos - start;
3090
+ let nextChar = pos < max ? this.src.charCodeAt(pos) : 32;
3091
+ if ((nextChar & 64512) === 55296) {
3092
+ const lowSurr = this.src.charCodeAt(pos + 1);
3093
+ nextChar = (lowSurr & 64512) === 56320 ? 65536 + (nextChar - 55296 << 10) + (lowSurr - 56320) : 65533;
3094
+ } else if ((nextChar & 64512) === 56320) nextChar = 65533;
3095
+ const isLastPunctChar = isMdAsciiPunct(lastChar) || isPunctCharCode(lastChar);
3096
+ const isNextPunctChar = isMdAsciiPunct(nextChar) || isPunctCharCode(nextChar);
3097
+ const isLastWhiteSpace = isWhiteSpace(lastChar);
3098
+ const isNextWhiteSpace = isWhiteSpace(nextChar);
3099
+ const left_flanking = !isNextWhiteSpace && (!isNextPunctChar || isLastWhiteSpace || isLastPunctChar);
3100
+ const right_flanking = !isLastWhiteSpace && (!isLastPunctChar || isNextWhiteSpace || isNextPunctChar);
3101
+ return {
3102
+ can_open: left_flanking && (canSplitWord || !right_flanking || isLastPunctChar),
3103
+ can_close: right_flanking && (canSplitWord || !left_flanking || isNextPunctChar),
3104
+ length: count
3105
+ };
3106
+ }
3107
+ };
3108
+ //#endregion
3109
+ //#region src/rules_inline/text.ts
3110
+ function isTerminatorChar(ch) {
3111
+ switch (ch) {
3112
+ case 10:
3113
+ case 33:
3114
+ case 35:
3115
+ case 36:
3116
+ case 37:
3117
+ case 38:
3118
+ case 42:
3119
+ case 43:
3120
+ case 45:
3121
+ case 58:
3122
+ case 60:
3123
+ case 61:
3124
+ case 62:
3125
+ case 64:
3126
+ case 91:
3127
+ case 92:
3128
+ case 93:
3129
+ case 94:
3130
+ case 95:
3131
+ case 96:
3132
+ case 123:
3133
+ case 125:
3134
+ case 126: return true;
3135
+ default: return false;
3136
+ }
3137
+ }
3138
+ function text(state, silent) {
3139
+ let pos = state.pos;
3140
+ while (pos < state.posMax && !isTerminatorChar(state.src.charCodeAt(pos))) pos++;
3141
+ if (pos === state.pos) return false;
3142
+ if (!silent) state.pending += state.src.slice(state.pos, pos);
3143
+ state.pos = pos;
3144
+ return true;
3145
+ }
3146
+ //#endregion
3147
+ //#region src/rules_inline/linkify.ts
3148
+ function isAsciiAlpha(code) {
3149
+ return code >= 65 && code <= 90 || code >= 97 && code <= 122;
3150
+ }
3151
+ function isSchemeChar(code) {
3152
+ return code >= 65 && code <= 90 || code >= 97 && code <= 122 || code >= 48 && code <= 57 || code === 43 || code === 45 || code === 46;
3153
+ }
3154
+ function linkify(state, silent) {
3155
+ if (!state.md.options.linkify) return false;
3156
+ if (state.linkLevel > 0) return false;
3157
+ const pos = state.pos;
3158
+ const max = state.posMax;
3159
+ if (pos + 3 > max) return false;
3160
+ if (state.src.charCodeAt(pos) !== 58) return false;
3161
+ if (state.src.charCodeAt(pos + 1) !== 47) return false;
3162
+ if (state.src.charCodeAt(pos + 2) !== 47) return false;
3163
+ const protoMin = pos - Math.min(10, state.pending.length, pos);
3164
+ let protoStart = pos;
3165
+ while (protoStart > protoMin && isSchemeChar(state.src.charCodeAt(protoStart - 1))) protoStart--;
3166
+ if (protoStart === pos || !isAsciiAlpha(state.src.charCodeAt(protoStart))) return false;
3167
+ const protoLength = pos - protoStart;
3168
+ const link = state.md.linkify.matchAtStart(state.src.slice(protoStart));
3169
+ if (!link) return false;
3170
+ let url = link.url;
3171
+ if (url.length <= protoLength) return false;
3172
+ let urlEnd = url.length;
3173
+ while (urlEnd > 0 && url.charCodeAt(urlEnd - 1) === 42) urlEnd--;
3174
+ if (urlEnd !== url.length) url = url.slice(0, urlEnd);
3175
+ const fullUrl = state.md.normalizeLink(url);
3176
+ if (!state.md.validateLink(fullUrl)) return false;
3177
+ if (!silent) {
3178
+ state.pending = state.pending.slice(0, -protoLength);
3179
+ const token_o = state.push("link_open", "a", 1);
3180
+ token_o.attrs = [["href", fullUrl]];
3181
+ token_o.markup = "linkify";
3182
+ token_o.info = "auto";
3183
+ const token_t = state.push("text", "", 0);
3184
+ token_t.content = state.md.normalizeLinkText(url);
3185
+ const token_c = state.push("link_close", "a", -1);
3186
+ token_c.markup = "linkify";
3187
+ token_c.info = "auto";
3188
+ }
3189
+ state.pos += url.length - protoLength;
3190
+ return true;
3191
+ }
3192
+ //#endregion
3193
+ //#region src/rules_inline/newline.ts
3194
+ function newline(state, silent) {
3195
+ let pos = state.pos;
3196
+ if (state.src.charCodeAt(pos) !== 10) return false;
3197
+ const pmax = state.pending.length - 1;
3198
+ const max = state.posMax;
3199
+ if (!silent) if (pmax >= 0 && state.pending.charCodeAt(pmax) === 32) if (pmax >= 1 && state.pending.charCodeAt(pmax - 1) === 32) {
3200
+ let ws = pmax - 1;
3201
+ while (ws >= 1 && state.pending.charCodeAt(ws - 1) === 32) ws--;
3202
+ state.pending = state.pending.slice(0, ws);
3203
+ state.push("hardbreak", "br", 0);
3204
+ } else {
3205
+ state.pending = state.pending.slice(0, -1);
3206
+ state.push("softbreak", "br", 0);
3207
+ }
3208
+ else state.push("softbreak", "br", 0);
3209
+ pos++;
3210
+ while (pos < max && isSpace(state.src.charCodeAt(pos))) pos++;
3211
+ state.pos = pos;
3212
+ return true;
3213
+ }
3214
+ //#endregion
3215
+ //#region src/rules_inline/escape.ts
3216
+ var ESCAPED = [];
3217
+ for (let i = 0; i < 256; i++) ESCAPED.push(0);
3218
+ "\\!\"#$%&'()*+,./:;<=>?@[]^_`{|}~-".split("").forEach(function(ch) {
3219
+ ESCAPED[ch.charCodeAt(0)] = 1;
3220
+ });
3221
+ function escape(state, silent) {
3222
+ let pos = state.pos;
3223
+ const max = state.posMax;
3224
+ if (state.src.charCodeAt(pos) !== 92) return false;
3225
+ pos++;
3226
+ if (pos >= max) return false;
3227
+ let ch1 = state.src.charCodeAt(pos);
3228
+ if (ch1 === 10) {
3229
+ if (!silent) state.push("hardbreak", "br", 0);
3230
+ pos++;
3231
+ while (pos < max) {
3232
+ ch1 = state.src.charCodeAt(pos);
3233
+ if (!isSpace(ch1)) break;
3234
+ pos++;
3235
+ }
3236
+ state.pos = pos;
3237
+ return true;
3238
+ }
3239
+ if (ch1 === 32) {
3240
+ if (!silent) {
3241
+ const token = state.push("text_special", "", 0);
3242
+ token.content = "\\";
3243
+ token.markup = "\\";
3244
+ token.info = "escape";
3245
+ }
3246
+ state.pos = pos;
3247
+ return true;
3248
+ }
3249
+ let escapedStr = state.src[pos];
3250
+ if (ch1 >= 55296 && ch1 <= 56319 && pos + 1 < max) {
3251
+ const ch2 = state.src.charCodeAt(pos + 1);
3252
+ if (ch2 >= 56320 && ch2 <= 57343) {
3253
+ escapedStr += state.src[pos + 1];
3254
+ pos++;
3255
+ }
3256
+ }
3257
+ const origStr = "\\" + escapedStr;
3258
+ if (!silent) {
3259
+ const token = state.push("text_special", "", 0);
3260
+ if (ch1 < 256 && ESCAPED[ch1] !== 0) token.content = escapedStr;
3261
+ else token.content = origStr;
3262
+ token.markup = origStr;
3263
+ token.info = "escape";
3264
+ }
3265
+ state.pos = pos + 1;
3266
+ return true;
3267
+ }
3268
+ //#endregion
3269
+ //#region src/rules_inline/backticks.ts
3270
+ function buildLastRuns(src) {
3271
+ const lastRuns = {};
3272
+ let pos = 0;
3273
+ while ((pos = src.indexOf("`", pos)) !== -1) {
3274
+ const start = pos;
3275
+ while (src.charCodeAt(++pos) === 96);
3276
+ lastRuns[pos - start] = start;
3277
+ }
3278
+ return lastRuns;
3279
+ }
3280
+ function backtick(state, silent) {
3281
+ var _state$backticks$open;
3282
+ const start = state.pos;
3283
+ if (state.src.charCodeAt(start) !== 96) return false;
3284
+ const max = state.posMax;
3285
+ let pos = start + 1;
3286
+ while (pos < max && state.src.charCodeAt(pos) === 96) pos++;
3287
+ const marker = state.src.slice(start, pos);
3288
+ const openerLength = marker.length;
3289
+ if (!state.backticksScanned) {
3290
+ state.backticks = buildLastRuns(state.src);
3291
+ state.backticksScanned = true;
3292
+ }
3293
+ if (((_state$backticks$open = state.backticks[openerLength]) !== null && _state$backticks$open !== void 0 ? _state$backticks$open : -1) >= pos) {
3294
+ let matchEnd = pos;
3295
+ let matchStart;
3296
+ while ((matchStart = state.src.indexOf("`", matchEnd)) !== -1 && matchStart < max) {
3297
+ matchEnd = matchStart + 1;
3298
+ while (state.src.charCodeAt(matchEnd) === 96) matchEnd++;
3299
+ if (matchEnd > max) break;
3300
+ if (matchEnd - matchStart === openerLength) {
3301
+ if (!silent) {
3302
+ const token = state.push("code_inline", "code", 0);
3303
+ token.markup = marker;
3304
+ let content = state.src.slice(pos, matchStart).replace(/\n/g, " ");
3305
+ if (content.startsWith(" ") && content.endsWith(" ") && /[^ ]/.test(content)) content = content.slice(1, -1);
3306
+ token.content = content;
3307
+ }
3308
+ state.pos = matchEnd;
3309
+ return true;
3310
+ }
3311
+ }
3312
+ }
3313
+ if (!silent) state.pending += marker;
3314
+ state.pos = pos;
3315
+ return true;
3316
+ }
3317
+ //#endregion
3318
+ //#region src/rules_inline/strikethrough.ts
3319
+ function strikethrough_tokenize(state, silent) {
3320
+ const start = state.pos;
3321
+ const marker = state.src.charCodeAt(start);
3322
+ if (silent) return false;
3323
+ if (marker !== 126) return false;
3324
+ const scanned = state.scanDelims(state.pos, true);
3325
+ let len = scanned.length;
3326
+ const ch = String.fromCharCode(marker);
3327
+ if (len < 2) return false;
3328
+ let token;
3329
+ if (len % 2) {
3330
+ token = state.push("text", "", 0);
3331
+ token.content = ch;
3332
+ len--;
3333
+ }
3334
+ for (let i = 0; i < len; i += 2) {
3335
+ token = state.push("text", "", 0);
3336
+ token.content = ch + ch;
3337
+ state.delimiters.push({
3338
+ marker,
3339
+ length: 0,
3340
+ token: state.tokens.length - 1,
3341
+ end: -1,
3342
+ open: scanned.can_open,
3343
+ close: scanned.can_close
3344
+ });
3345
+ }
3346
+ state.pos += scanned.length;
3347
+ return true;
3348
+ }
3349
+ function postProcess$1(state, delimiters) {
3350
+ let token;
3351
+ const loneMarkers = [];
3352
+ const max = delimiters.length;
3353
+ for (let i = 0; i < max; i++) {
3354
+ const startDelim = delimiters[i];
3355
+ if (startDelim.marker !== 126) continue;
3356
+ if (startDelim.end === -1) continue;
3357
+ const endDelim = delimiters[startDelim.end];
3358
+ token = state.tokens[startDelim.token];
3359
+ token.type = "s_open";
3360
+ token.tag = "s";
3361
+ token.nesting = 1;
3362
+ token.markup = "~~";
3363
+ token.content = "";
3364
+ token = state.tokens[endDelim.token];
3365
+ token.type = "s_close";
3366
+ token.tag = "s";
3367
+ token.nesting = -1;
3368
+ token.markup = "~~";
3369
+ token.content = "";
3370
+ if (state.tokens[endDelim.token - 1].type === "text" && state.tokens[endDelim.token - 1].content === "~") loneMarkers.push(endDelim.token - 1);
3371
+ }
3372
+ while (loneMarkers.length) {
3373
+ const i = loneMarkers.pop();
3374
+ let j = i + 1;
3375
+ while (j < state.tokens.length && state.tokens[j].type === "s_close") j++;
3376
+ j--;
3377
+ if (i !== j) {
3378
+ token = state.tokens[j];
3379
+ state.tokens[j] = state.tokens[i];
3380
+ state.tokens[i] = token;
3381
+ }
3382
+ }
3383
+ }
3384
+ function strikethrough_postProcess(state) {
3385
+ const tokens_meta = state.tokens_meta;
3386
+ const max = state.tokens_meta.length;
3387
+ postProcess$1(state, state.delimiters);
3388
+ for (let curr = 0; curr < max; curr++) {
3389
+ var _tokens_meta$curr;
3390
+ const delimiters = (_tokens_meta$curr = tokens_meta[curr]) === null || _tokens_meta$curr === void 0 ? void 0 : _tokens_meta$curr.delimiters;
3391
+ if (delimiters) postProcess$1(state, delimiters);
3392
+ }
3393
+ }
3394
+ var strikethrough_default = {
3395
+ tokenize: strikethrough_tokenize,
3396
+ postProcess: strikethrough_postProcess
3397
+ };
3398
+ //#endregion
3399
+ //#region src/rules_inline/emphasis.ts
3400
+ function emphasis_tokenize(state, silent) {
3401
+ const start = state.pos;
3402
+ const marker = state.src.charCodeAt(start);
3403
+ if (silent) return false;
3404
+ if (marker !== 95 && marker !== 42) return false;
3405
+ const scanned = state.scanDelims(state.pos, marker === 42);
3406
+ for (let i = 0; i < scanned.length; i++) {
3407
+ const token = state.push("text", "", 0);
3408
+ token.content = String.fromCharCode(marker);
3409
+ state.delimiters.push({
3410
+ marker,
3411
+ length: scanned.length,
3412
+ token: state.tokens.length - 1,
3413
+ end: -1,
3414
+ open: scanned.can_open,
3415
+ close: scanned.can_close
3416
+ });
3417
+ }
3418
+ state.pos += scanned.length;
3419
+ return true;
3420
+ }
3421
+ function postProcess(state, delimiters) {
3422
+ const max = delimiters.length;
3423
+ for (let i = max - 1; i >= 0; i--) {
3424
+ const startDelim = delimiters[i];
3425
+ if (startDelim.marker !== 95 && startDelim.marker !== 42) continue;
3426
+ if (startDelim.end === -1) continue;
3427
+ const endDelim = delimiters[startDelim.end];
3428
+ const isStrong = i > 0 && delimiters[i - 1].end === startDelim.end + 1 && delimiters[i - 1].marker === startDelim.marker && delimiters[i - 1].token === startDelim.token - 1 && delimiters[startDelim.end + 1].token === endDelim.token + 1;
3429
+ const ch = String.fromCharCode(startDelim.marker);
3430
+ const token_o = state.tokens[startDelim.token];
3431
+ token_o.type = isStrong ? "strong_open" : "em_open";
3432
+ token_o.tag = isStrong ? "strong" : "em";
3433
+ token_o.nesting = 1;
3434
+ token_o.markup = isStrong ? ch + ch : ch;
3435
+ token_o.content = "";
3436
+ const token_c = state.tokens[endDelim.token];
3437
+ token_c.type = isStrong ? "strong_close" : "em_close";
3438
+ token_c.tag = isStrong ? "strong" : "em";
3439
+ token_c.nesting = -1;
3440
+ token_c.markup = isStrong ? ch + ch : ch;
3441
+ token_c.content = "";
3442
+ if (isStrong) {
3443
+ state.tokens[delimiters[i - 1].token].content = "";
3444
+ state.tokens[delimiters[startDelim.end + 1].token].content = "";
3445
+ i--;
3446
+ }
3447
+ }
3448
+ }
3449
+ function emphasis_post_process(state) {
3450
+ const tokens_meta = state.tokens_meta;
3451
+ const max = state.tokens_meta.length;
3452
+ postProcess(state, state.delimiters);
3453
+ for (let curr = 0; curr < max; curr++) {
3454
+ var _tokens_meta$curr;
3455
+ const delimiters = (_tokens_meta$curr = tokens_meta[curr]) === null || _tokens_meta$curr === void 0 ? void 0 : _tokens_meta$curr.delimiters;
3456
+ if (delimiters) postProcess(state, delimiters);
3457
+ }
3458
+ }
3459
+ var emphasis_default = {
3460
+ tokenize: emphasis_tokenize,
3461
+ postProcess: emphasis_post_process
3462
+ };
3463
+ //#endregion
3464
+ //#region src/rules_inline/link.ts
3465
+ function link(state, silent) {
3466
+ let code, label, res, ref;
3467
+ let href = "";
3468
+ let title = "";
3469
+ let start = state.pos;
3470
+ let parseReference = true;
3471
+ if (state.src.charCodeAt(state.pos) !== 91) return false;
3472
+ const oldPos = state.pos;
3473
+ const max = state.posMax;
3474
+ const labelStart = state.pos + 1;
3475
+ const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos, true);
3476
+ if (labelEnd < 0) return false;
3477
+ let pos = labelEnd + 1;
3478
+ if (pos < max && state.src.charCodeAt(pos) === 40) {
3479
+ parseReference = false;
3480
+ pos++;
3481
+ for (; pos < max; pos++) {
3482
+ code = state.src.charCodeAt(pos);
3483
+ if (!isSpace(code) && code !== 10) break;
3484
+ }
3485
+ if (pos >= max) return false;
3486
+ start = pos;
3487
+ res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
3488
+ if (res.ok) {
3489
+ href = state.md.normalizeLink(res.str);
3490
+ if (state.md.validateLink(href)) pos = res.pos;
3491
+ else href = "";
3492
+ start = pos;
3493
+ for (; pos < max; pos++) {
3494
+ code = state.src.charCodeAt(pos);
3495
+ if (!isSpace(code) && code !== 10) break;
3496
+ }
3497
+ res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
3498
+ if (pos < max && start !== pos && res.ok) {
3499
+ title = res.str;
3500
+ pos = res.pos;
3501
+ for (; pos < max; pos++) {
3502
+ code = state.src.charCodeAt(pos);
3503
+ if (!isSpace(code) && code !== 10) break;
3504
+ }
3505
+ }
3506
+ }
3507
+ if (pos >= max || state.src.charCodeAt(pos) !== 41) parseReference = true;
3508
+ pos++;
3509
+ }
3510
+ if (parseReference) {
3511
+ if (typeof state.env.references === "undefined") return false;
3512
+ if (pos < max && state.src.charCodeAt(pos) === 91) {
3513
+ start = pos + 1;
3514
+ pos = state.md.helpers.parseLinkLabel(state, pos);
3515
+ if (pos >= 0) label = state.src.slice(start, pos++);
3516
+ else pos = labelEnd + 1;
3517
+ } else pos = labelEnd + 1;
3518
+ if (!label) label = state.src.slice(labelStart, labelEnd);
3519
+ label = normalizeReference(label);
3520
+ ref = state.env.references[label];
3521
+ if (!ref) {
3522
+ state.pos = oldPos;
3523
+ return false;
3524
+ }
3525
+ href = ref.href;
3526
+ title = ref.title;
3527
+ }
3528
+ if (!silent) {
3529
+ state.pos = labelStart;
3530
+ state.posMax = labelEnd;
3531
+ const token_o = state.push("link_open", "a", 1);
3532
+ const attrs = [["href", href]];
3533
+ token_o.attrs = attrs;
3534
+ if (title) attrs.push(["title", title]);
3535
+ if (label) {
3536
+ const meta = Object.create(null);
3537
+ meta.label = label;
3538
+ token_o.meta = meta;
3539
+ }
3540
+ state.linkLevel++;
3541
+ state.md.inline.tokenize(state);
3542
+ state.linkLevel--;
3543
+ state.push("link_close", "a", -1);
3544
+ }
3545
+ state.pos = pos;
3546
+ state.posMax = max;
3547
+ return true;
3548
+ }
3549
+ //#endregion
3550
+ //#region src/rules_inline/image.ts
3551
+ function image(state, silent) {
3552
+ let code, content, label, pos, ref, res, title, start;
3553
+ let href = "";
3554
+ const oldPos = state.pos;
3555
+ const max = state.posMax;
3556
+ if (state.src.charCodeAt(state.pos) !== 33) return false;
3557
+ if (state.src.charCodeAt(state.pos + 1) !== 91) return false;
3558
+ const labelStart = state.pos + 2;
3559
+ const labelEnd = state.md.helpers.parseLinkLabel(state, state.pos + 1, false);
3560
+ if (labelEnd < 0) return false;
3561
+ pos = labelEnd + 1;
3562
+ if (pos < max && state.src.charCodeAt(pos) === 40) {
3563
+ pos++;
3564
+ for (; pos < max; pos++) {
3565
+ code = state.src.charCodeAt(pos);
3566
+ if (!isSpace(code) && code !== 10) break;
3567
+ }
3568
+ if (pos >= max) return false;
3569
+ start = pos;
3570
+ res = state.md.helpers.parseLinkDestination(state.src, pos, state.posMax);
3571
+ if (res.ok) {
3572
+ href = state.md.normalizeLink(res.str);
3573
+ if (state.md.validateLink(href)) pos = res.pos;
3574
+ else href = "";
3575
+ }
3576
+ start = pos;
3577
+ for (; pos < max; pos++) {
3578
+ code = state.src.charCodeAt(pos);
3579
+ if (!isSpace(code) && code !== 10) break;
3580
+ }
3581
+ res = state.md.helpers.parseLinkTitle(state.src, pos, state.posMax);
3582
+ if (pos < max && start !== pos && res.ok) {
3583
+ title = res.str;
3584
+ pos = res.pos;
3585
+ for (; pos < max; pos++) {
3586
+ code = state.src.charCodeAt(pos);
3587
+ if (!isSpace(code) && code !== 10) break;
3588
+ }
3589
+ } else title = "";
3590
+ if (pos >= max || state.src.charCodeAt(pos) !== 41) {
3591
+ state.pos = oldPos;
3592
+ return false;
3593
+ }
3594
+ pos++;
3595
+ } else {
3596
+ if (typeof state.env.references === "undefined") return false;
3597
+ if (pos < max && state.src.charCodeAt(pos) === 91) {
3598
+ start = pos + 1;
3599
+ pos = state.md.helpers.parseLinkLabel(state, pos);
3600
+ if (pos >= 0) label = state.src.slice(start, pos++);
3601
+ else pos = labelEnd + 1;
3602
+ } else pos = labelEnd + 1;
3603
+ if (!label) label = state.src.slice(labelStart, labelEnd);
3604
+ label = normalizeReference(label);
3605
+ ref = state.env.references[label];
3606
+ if (!ref) {
3607
+ state.pos = oldPos;
3608
+ return false;
3609
+ }
3610
+ href = ref.href;
3611
+ title = ref.title;
3612
+ }
3613
+ if (!silent) {
3614
+ content = state.src.slice(labelStart, labelEnd);
3615
+ const tokens = [];
3616
+ state.md.inline.parse(content, state.md, state.env, tokens);
3617
+ const token = state.push("image", "img", 0);
3618
+ const attrs = [["src", href], ["alt", ""]];
3619
+ token.attrs = attrs;
3620
+ token.children = tokens;
3621
+ token.content = content;
3622
+ if (title) attrs.push(["title", title]);
3623
+ if (label) {
3624
+ const meta = Object.create(null);
3625
+ meta.label = label;
3626
+ token.meta = meta;
3627
+ }
3628
+ }
3629
+ state.pos = pos;
3630
+ state.posMax = max;
3631
+ return true;
3632
+ }
3633
+ //#endregion
3634
+ //#region src/rules_inline/autolink.ts
3635
+ var 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])?)*)$/;
3636
+ var AUTOLINK_RE = /^([a-zA-Z][a-zA-Z0-9+.-]{1,31}):([^<>\x00-\x20]*)$/;
3637
+ function autolink(state, silent) {
3638
+ let pos = state.pos;
3639
+ if (state.src.charCodeAt(pos) !== 60) return false;
3640
+ const start = state.pos;
3641
+ const max = state.posMax;
3642
+ for (;;) {
3643
+ if (++pos >= max) return false;
3644
+ const ch = state.src.charCodeAt(pos);
3645
+ if (ch === 60) return false;
3646
+ if (ch === 62) break;
3647
+ }
3648
+ const url = state.src.slice(start + 1, pos);
3649
+ if (AUTOLINK_RE.test(url)) {
3650
+ const fullUrl = state.md.normalizeLink(url);
3651
+ if (!state.md.validateLink(fullUrl)) return false;
3652
+ if (!silent) {
3653
+ const token_o = state.push("link_open", "a", 1);
3654
+ token_o.attrs = [["href", fullUrl]];
3655
+ token_o.markup = "autolink";
3656
+ token_o.info = "auto";
3657
+ const token_t = state.push("text", "", 0);
3658
+ token_t.content = state.md.normalizeLinkText(url);
3659
+ const token_c = state.push("link_close", "a", -1);
3660
+ token_c.markup = "autolink";
3661
+ token_c.info = "auto";
3662
+ }
3663
+ state.pos += url.length + 2;
3664
+ return true;
3665
+ }
3666
+ if (EMAIL_RE.test(url)) {
3667
+ const fullUrl = state.md.normalizeLink(`mailto:${url}`);
3668
+ if (!state.md.validateLink(fullUrl)) return false;
3669
+ if (!silent) {
3670
+ const token_o = state.push("link_open", "a", 1);
3671
+ token_o.attrs = [["href", fullUrl]];
3672
+ token_o.markup = "autolink";
3673
+ token_o.info = "auto";
3674
+ const token_t = state.push("text", "", 0);
3675
+ token_t.content = state.md.normalizeLinkText(url);
3676
+ const token_c = state.push("link_close", "a", -1);
3677
+ token_c.markup = "autolink";
3678
+ token_c.info = "auto";
3679
+ }
3680
+ state.pos += url.length + 2;
3681
+ return true;
3682
+ }
3683
+ return false;
3684
+ }
3685
+ //#endregion
3686
+ //#region src/rules_inline/html_inline.ts
3687
+ function isLinkOpen(str) {
3688
+ return /^<a[>\s]/i.test(str);
3689
+ }
3690
+ function isLinkClose(str) {
3691
+ return /^<\/a\s*>/i.test(str);
3692
+ }
3693
+ function isLetter(ch) {
3694
+ const lc = ch | 32;
3695
+ return lc >= 97 && lc <= 122;
3696
+ }
3697
+ function html_inline(state, silent) {
3698
+ if (!state.md.options.html) return false;
3699
+ const max = state.posMax;
3700
+ const pos = state.pos;
3701
+ if (state.src.charCodeAt(pos) !== 60 || pos + 2 >= max) return false;
3702
+ const ch = state.src.charCodeAt(pos + 1);
3703
+ if (ch !== 33 && ch !== 63 && ch !== 47 && !isLetter(ch)) return false;
3704
+ const match = state.src.slice(pos).match(HTML_TAG_RE);
3705
+ if (!match) return false;
3706
+ if (!silent) {
3707
+ const token = state.push("html_inline", "", 0);
3708
+ token.content = match[0];
3709
+ if (isLinkOpen(token.content)) state.linkLevel++;
3710
+ if (isLinkClose(token.content)) state.linkLevel--;
3711
+ }
3712
+ state.pos += match[0].length;
3713
+ return true;
3714
+ }
3715
+ //#endregion
3716
+ //#region src/rules_inline/entity.ts
3717
+ var DIGITAL_RE = /^&#((?:x[a-f0-9]{1,6}|[0-9]{1,7}));/i;
3718
+ var NAMED_RE = /^&([a-z][a-z0-9]{1,31});/i;
3719
+ function entity(state, silent) {
3720
+ const pos = state.pos;
3721
+ const max = state.posMax;
3722
+ if (state.src.charCodeAt(pos) !== 38) return false;
3723
+ if (pos + 1 >= max) return false;
3724
+ if (state.src.charCodeAt(pos + 1) === 35) {
3725
+ const match = state.src.slice(pos).match(DIGITAL_RE);
3726
+ if (match) {
3727
+ if (!silent) {
3728
+ const code = match[1][0].toLowerCase() === "x" ? parseInt(match[1].slice(1), 16) : parseInt(match[1], 10);
3729
+ const token = state.push("text_special", "", 0);
3730
+ token.content = isValidEntityCode(code) ? fromCodePoint(code) : fromCodePoint(65533);
3731
+ token.markup = match[0];
3732
+ token.info = "entity";
3733
+ }
3734
+ state.pos += match[0].length;
3735
+ return true;
3736
+ }
3737
+ } else {
3738
+ const match = state.src.slice(pos).match(NAMED_RE);
3739
+ if (match) {
3740
+ const decoded = decodeHTMLStrict(match[0]);
3741
+ if (decoded !== match[0]) {
3742
+ if (!silent) {
3743
+ const token = state.push("text_special", "", 0);
3744
+ token.content = decoded;
3745
+ token.markup = match[0];
3746
+ token.info = "entity";
3747
+ }
3748
+ state.pos += match[0].length;
3749
+ return true;
3750
+ }
3751
+ }
3752
+ }
3753
+ return false;
3754
+ }
3755
+ //#endregion
3756
+ //#region src/rules_inline/balance_pairs.ts
3757
+ function processDelimiters(delimiters) {
3758
+ const openersBottom = {};
3759
+ const max = delimiters.length;
3760
+ if (!max) return;
3761
+ let headerIdx = 0;
3762
+ let lastTokenIdx = -2;
3763
+ const jumps = [];
3764
+ for (let closerIdx = 0; closerIdx < max; closerIdx++) {
3765
+ const closer = delimiters[closerIdx];
3766
+ jumps.push(0);
3767
+ if (delimiters[headerIdx].marker !== closer.marker || lastTokenIdx !== closer.token - 1) headerIdx = closerIdx;
3768
+ lastTokenIdx = closer.token;
3769
+ closer.length = closer.length || 0;
3770
+ if (!closer.close) continue;
3771
+ if (!openersBottom.hasOwnProperty(closer.marker)) openersBottom[closer.marker] = [
3772
+ -1,
3773
+ -1,
3774
+ -1,
3775
+ -1,
3776
+ -1,
3777
+ -1
3778
+ ];
3779
+ const minOpenerIdx = openersBottom[closer.marker][(closer.open ? 3 : 0) + closer.length % 3];
3780
+ let openerIdx = headerIdx - jumps[headerIdx] - 1;
3781
+ let newMinOpenerIdx = openerIdx;
3782
+ for (; openerIdx > minOpenerIdx; openerIdx -= jumps[openerIdx] + 1) {
3783
+ const opener = delimiters[openerIdx];
3784
+ if (opener.marker !== closer.marker) continue;
3785
+ if (opener.open && opener.end < 0) {
3786
+ let isOddMatch = false;
3787
+ if (opener.close || closer.open) {
3788
+ if ((opener.length + closer.length) % 3 === 0) {
3789
+ if (opener.length % 3 !== 0 || closer.length % 3 !== 0) isOddMatch = true;
3790
+ }
3791
+ }
3792
+ if (!isOddMatch) {
3793
+ const lastJump = openerIdx > 0 && !delimiters[openerIdx - 1].open ? jumps[openerIdx - 1] + 1 : 0;
3794
+ jumps[closerIdx] = closerIdx - openerIdx + lastJump;
3795
+ jumps[openerIdx] = lastJump;
3796
+ closer.open = false;
3797
+ opener.end = closerIdx;
3798
+ opener.close = false;
3799
+ newMinOpenerIdx = -1;
3800
+ lastTokenIdx = -2;
3801
+ break;
3802
+ }
3803
+ }
3804
+ }
3805
+ if (newMinOpenerIdx !== -1) openersBottom[closer.marker][(closer.open ? 3 : 0) + (closer.length || 0) % 3] = newMinOpenerIdx;
3806
+ }
3807
+ }
3808
+ function link_pairs(state) {
3809
+ const tokens_meta = state.tokens_meta;
3810
+ const max = state.tokens_meta.length;
3811
+ processDelimiters(state.delimiters);
3812
+ for (let curr = 0; curr < max; curr++) {
3813
+ var _tokens_meta$curr;
3814
+ const delimiters = (_tokens_meta$curr = tokens_meta[curr]) === null || _tokens_meta$curr === void 0 ? void 0 : _tokens_meta$curr.delimiters;
3815
+ if (delimiters) processDelimiters(delimiters);
3816
+ }
3817
+ }
3818
+ //#endregion
3819
+ //#region src/rules_inline/fragments_join.ts
3820
+ function fragments_join(state) {
3821
+ let curr, last;
3822
+ let level = 0;
3823
+ const tokens = state.tokens;
3824
+ const max = state.tokens.length;
3825
+ for (curr = last = 0; curr < max; curr++) {
3826
+ if (tokens[curr].nesting < 0) level--;
3827
+ tokens[curr].level = level;
3828
+ if (tokens[curr].nesting > 0) level++;
3829
+ if (tokens[curr].type === "text" && curr + 1 < max && tokens[curr + 1].type === "text") tokens[curr + 1].content = tokens[curr].content + tokens[curr + 1].content;
3830
+ else {
3831
+ if (curr !== last) tokens[last] = tokens[curr];
3832
+ last++;
3833
+ }
3834
+ }
3835
+ if (curr !== last) tokens.length = last;
3836
+ }
3837
+ //#endregion
3838
+ //#region src/parser_inline.ts
3839
+ var _rules = [
3840
+ ["text", text],
3841
+ ["linkify", linkify],
3842
+ ["newline", newline],
3843
+ ["escape", escape],
3844
+ ["backticks", backtick],
3845
+ ["strikethrough", strikethrough_default.tokenize],
3846
+ ["emphasis", emphasis_default.tokenize],
3847
+ ["link", link],
3848
+ ["image", image],
3849
+ ["autolink", autolink],
3850
+ ["html_inline", html_inline],
3851
+ ["entity", entity]
3852
+ ];
3853
+ var _rules2 = [
3854
+ ["balance_pairs", link_pairs],
3855
+ ["strikethrough", strikethrough_default.postProcess],
3856
+ ["emphasis", emphasis_default.postProcess],
3857
+ ["fragments_join", fragments_join]
3858
+ ];
3859
+ /**
3860
+ * Tokenizes paragraph content.
3861
+ */
3862
+ var ParserInline = class {
3863
+ constructor() {
3864
+ _defineProperty(
3865
+ this,
3866
+ /**
3867
+ * {@link Ruler} instance. Keep configuration of inline rules.
3868
+ */
3869
+ "ruler",
3870
+ new Ruler()
3871
+ );
3872
+ _defineProperty(
3873
+ this,
3874
+ /**
3875
+ * {@link Ruler} instance. Second ruler used for post-processing
3876
+ * (e.g. in emphasis-like rules).
3877
+ */
3878
+ "ruler2",
3879
+ new Ruler()
3880
+ );
3881
+ _defineProperty(this, "State", StateInline);
3882
+ for (let i = 0; i < _rules.length; i++) this.ruler.push(_rules[i][0], _rules[i][1]);
3883
+ for (let i = 0; i < _rules2.length; i++) this.ruler2.push(_rules2[i][0], _rules2[i][1]);
3884
+ }
3885
+ skipToken(state) {
3886
+ const pos = state.pos;
3887
+ const rules = this.ruler.getRules("");
3888
+ const len = rules.length;
3889
+ const maxNesting = state.md.options.maxNesting;
3890
+ const cache = state.cache;
3891
+ if (typeof cache[pos] !== "undefined") {
3892
+ state.pos = cache[pos];
3893
+ return;
3894
+ }
3895
+ let ok = false;
3896
+ if (state.level < maxNesting) for (let i = 0; i < len; i++) {
3897
+ state.level++;
3898
+ ok = rules[i](state, true);
3899
+ state.level--;
3900
+ if (ok) {
3901
+ if (pos >= state.pos) throw new Error("inline rule didn't increment state.pos");
3902
+ break;
3903
+ }
3904
+ }
3905
+ else state.pos = state.posMax;
3906
+ if (!ok) state.pos++;
3907
+ cache[pos] = state.pos;
3908
+ }
3909
+ tokenize(state) {
3910
+ const rules = this.ruler.getRules("");
3911
+ const len = rules.length;
3912
+ const end = state.posMax;
3913
+ const maxNesting = state.md.options.maxNesting;
3914
+ while (state.pos < end) {
3915
+ const prevPos = state.pos;
3916
+ let ok = false;
3917
+ if (state.level < maxNesting) for (let i = 0; i < len; i++) {
3918
+ ok = rules[i](state, false);
3919
+ if (ok) {
3920
+ if (prevPos >= state.pos) throw new Error("inline rule didn't increment state.pos");
3921
+ break;
3922
+ }
3923
+ }
3924
+ if (ok) {
3925
+ if (state.pos >= end) break;
3926
+ continue;
3927
+ }
3928
+ state.pending += state.src[state.pos++];
3929
+ }
3930
+ if (state.pending) state.pushPending();
3931
+ }
3932
+ /**
3933
+ * Process input string and push inline tokens into `outTokens`
3934
+ */
3935
+ parse(str, md, env, outTokens) {
3936
+ const state = new this.State(str, md, env, outTokens);
3937
+ this.tokenize(state);
3938
+ const rules = this.ruler2.getRules("");
3939
+ const len = rules.length;
3940
+ for (let i = 0; i < len; i++) rules[i](state);
3941
+ }
3942
+ };
3943
+ var default_default = {
3944
+ options: {
3945
+ html: false,
3946
+ xhtmlOut: false,
3947
+ breaks: false,
3948
+ langPrefix: "language-",
3949
+ linkify: false,
3950
+ typographer: false,
3951
+ quotes: "“”‘’",
3952
+ highlight: null,
3953
+ maxNesting: 100
3954
+ },
3955
+ components: {
3956
+ core: {},
3957
+ block: {},
3958
+ inline: {}
3959
+ }
3960
+ };
3961
+ var zero_default = {
3962
+ options: {
3963
+ html: false,
3964
+ xhtmlOut: false,
3965
+ breaks: false,
3966
+ langPrefix: "language-",
3967
+ linkify: false,
3968
+ typographer: false,
3969
+ quotes: "“”‘’",
3970
+ highlight: null,
3971
+ maxNesting: 20
3972
+ },
3973
+ components: {
3974
+ core: { rules: [
3975
+ "normalize",
3976
+ "block",
3977
+ "strip_references",
3978
+ "inline",
3979
+ "text_join"
3980
+ ] },
3981
+ block: { rules: ["paragraph"] },
3982
+ inline: {
3983
+ rules: ["text"],
3984
+ rules2: ["balance_pairs", "fragments_join"]
3985
+ }
3986
+ }
3987
+ };
3988
+ var commonmark_default = {
3989
+ options: {
3990
+ html: true,
3991
+ xhtmlOut: true,
3992
+ breaks: false,
3993
+ langPrefix: "language-",
3994
+ linkify: false,
3995
+ typographer: false,
3996
+ quotes: "“”‘’",
3997
+ highlight: null,
3998
+ maxNesting: 20
3999
+ },
4000
+ components: {
4001
+ core: { rules: [
4002
+ "normalize",
4003
+ "block",
4004
+ "strip_references",
4005
+ "inline",
4006
+ "text_join"
4007
+ ] },
4008
+ block: { rules: [
4009
+ "blockquote",
4010
+ "code",
4011
+ "fence",
4012
+ "heading",
4013
+ "hr",
4014
+ "html_block",
4015
+ "lheading",
4016
+ "list",
4017
+ "reference",
4018
+ "paragraph"
4019
+ ] },
4020
+ inline: {
4021
+ rules: [
4022
+ "autolink",
4023
+ "backticks",
4024
+ "emphasis",
4025
+ "entity",
4026
+ "escape",
4027
+ "html_inline",
4028
+ "image",
4029
+ "link",
4030
+ "newline",
4031
+ "text"
4032
+ ],
4033
+ rules2: [
4034
+ "balance_pairs",
4035
+ "emphasis",
4036
+ "fragments_join"
4037
+ ]
4038
+ }
4039
+ }
4040
+ };
4041
+ //#endregion
4042
+ //#region \0@oxc-project+runtime@0.142.0/helpers/esm/objectSpread2.js
4043
+ function ownKeys(e, r) {
4044
+ var t = Object.keys(e);
4045
+ if (Object.getOwnPropertySymbols) {
4046
+ var o = Object.getOwnPropertySymbols(e);
4047
+ r && (o = o.filter(function(r) {
4048
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
4049
+ })), t.push.apply(t, o);
4050
+ }
4051
+ return t;
4052
+ }
4053
+ function _objectSpread2(e) {
4054
+ for (var r = 1; r < arguments.length; r++) {
4055
+ var t = null != arguments[r] ? arguments[r] : {};
4056
+ r % 2 ? ownKeys(Object(t), !0).forEach(function(r) {
4057
+ _defineProperty(e, r, t[r]);
4058
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
4059
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
4060
+ });
4061
+ }
4062
+ return e;
4063
+ }
4064
+ //#endregion
4065
+ //#region src/markdownit.ts
4066
+ var config = {
4067
+ default: default_default,
4068
+ zero: zero_default,
4069
+ commonmark: commonmark_default
4070
+ };
4071
+ var BAD_PROTO_RE = /^(vbscript|javascript|file|data):/;
4072
+ var GOOD_DATA_RE = /^data:image\/(gif|png|jpeg|webp);/;
4073
+ var RECODE_HOSTNAME_FOR = [
4074
+ "http:",
4075
+ "https:",
4076
+ "mailto:"
4077
+ ];
4078
+ /**
4079
+ * Parses Markdown into tokens and renders them to HTML.
4080
+ *
4081
+ * @category Main
4082
+ */
4083
+ var MarkdownIt = class {
4084
+ /**
4085
+ * Link validation function. CommonMark allows too much in links. By default
4086
+ * we disable `javascript:`, `vbscript:`, `file:` schemas, and almost all `data:...` schemas
4087
+ * except some embedded image types.
4088
+ *
4089
+ * You can change this behaviour:
4090
+ *
4091
+ * @example
4092
+ * ```javascript
4093
+ * import MarkdownIt from 'markdown-it'
4094
+ * const md = new MarkdownIt()
4095
+ *
4096
+ * // enable everything
4097
+ * md.validateLink = function () { return true; }
4098
+ * ```
4099
+ */
4100
+ validateLink(url) {
4101
+ const str = url.trim().toLowerCase();
4102
+ return BAD_PROTO_RE.test(str) ? GOOD_DATA_RE.test(str) : true;
4103
+ }
4104
+ /**
4105
+ * Function used to encode link url to a machine-readable format,
4106
+ * which includes url-encoding, punycode, etc.
4107
+ */
4108
+ normalizeLink(url) {
4109
+ const parsed = mdurl.parse(url, true);
4110
+ if (parsed.hostname) {
4111
+ if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) try {
4112
+ parsed.hostname = punycode_js.default.toASCII(parsed.hostname);
4113
+ } catch (er) {}
4114
+ }
4115
+ if (parsed.auth) parsed.auth = mdurl.encode(parsed.auth);
4116
+ if (parsed.hostname) parsed.hostname = mdurl.encode(parsed.hostname);
4117
+ if (parsed.pathname) parsed.pathname = mdurl.encode(parsed.pathname);
4118
+ if (parsed.search) parsed.search = mdurl.encode(parsed.search);
4119
+ if (parsed.hash) parsed.hash = mdurl.encode(parsed.hash);
4120
+ return mdurl.format(parsed);
4121
+ }
4122
+ /**
4123
+ * Function used to decode link url to a human-readable format`
4124
+ */
4125
+ normalizeLinkText(url) {
4126
+ const parsed = mdurl.parse(url, true);
4127
+ if (parsed.hostname) {
4128
+ if (!parsed.protocol || RECODE_HOSTNAME_FOR.indexOf(parsed.protocol) >= 0) try {
4129
+ parsed.hostname = punycode_js.default.toUnicode(parsed.hostname);
4130
+ } catch (er) {}
4131
+ }
4132
+ return mdurl.decode(mdurl.format(parsed), mdurl.decode.defaultChars + "%");
4133
+ }
4134
+ constructor(...args) {
4135
+ _defineProperty(
4136
+ this,
4137
+ /**
4138
+ * Instance of {@link ParserInline}. You may need it to add new rules when
4139
+ * writing plugins. For simple rules control use {@link MarkdownIt.disable}
4140
+ * and {@link MarkdownIt.enable}.
4141
+ */
4142
+ "inline",
4143
+ new ParserInline()
4144
+ );
4145
+ _defineProperty(
4146
+ this,
4147
+ /**
4148
+ * Instance of {@link ParserBlock}. You may need it to add new rules when
4149
+ * writing plugins. For simple rules control use {@link MarkdownIt.disable}
4150
+ * and {@link MarkdownIt.enable}.
4151
+ */
4152
+ "block",
4153
+ new ParserBlock()
4154
+ );
4155
+ _defineProperty(
4156
+ this,
4157
+ /**
4158
+ * Instance of {@link ParserCore} chain executor. You may need it to add new
4159
+ * rules when writing plugins. For simple rules control use
4160
+ * {@link MarkdownIt.disable} and {@link MarkdownIt.enable}.
4161
+ */
4162
+ "core",
4163
+ new ParserCore()
4164
+ );
4165
+ _defineProperty(
4166
+ this,
4167
+ /**
4168
+ * Instance of {@link Renderer}. Use it to modify output look. Or to add rendering
4169
+ * rules for new token types, generated by plugins.
4170
+ *
4171
+ * See {@link Renderer} docs and
4172
+ * [source code](https://github.com/markdown-it/markdown-it/blob/master/src/renderer.ts).
4173
+ *
4174
+ * @example
4175
+ * ```javascript
4176
+ * import MarkdownIt from 'markdown-it'
4177
+ * const md = new MarkdownIt()
4178
+ *
4179
+ * function myToken(tokens, idx, options, env, self) {
4180
+ * //...
4181
+ * return result;
4182
+ * };
4183
+ *
4184
+ * md.renderer.rules['my_token'] = myToken
4185
+ * ```
4186
+ */
4187
+ "renderer",
4188
+ new Renderer()
4189
+ );
4190
+ _defineProperty(
4191
+ this,
4192
+ /**
4193
+ * [linkify-it](https://github.com/markdown-it/linkify-it) instance.
4194
+ * Used by [linkify](https://github.com/markdown-it/markdown-it/blob/master/src/rules_core/linkify.ts)
4195
+ * rule.
4196
+ */
4197
+ "linkify",
4198
+ new linkify_it.LinkifyIt()
4199
+ );
4200
+ _defineProperty(
4201
+ this,
4202
+ /**
4203
+ * Assorted utility functions, useful to write plugins. See details
4204
+ * [here](https://github.com/markdown-it/markdown-it/blob/master/src/common/utils.ts).
4205
+ */
4206
+ "utils",
4207
+ utils_exports
4208
+ );
4209
+ _defineProperty(
4210
+ this,
4211
+ /**
4212
+ * Link components parser functions, useful to write plugins. See details
4213
+ * [here](https://github.com/markdown-it/markdown-it/blob/master/src/helpers).
4214
+ */
4215
+ "helpers",
4216
+ Object.assign({}, helpers_exports)
4217
+ );
4218
+ const [presetNameOrOptions, options] = args;
4219
+ if (typeof presetNameOrOptions === "string") {
4220
+ this.configure(presetNameOrOptions);
4221
+ if (options) this.set(options);
4222
+ } else {
4223
+ this.configure("default");
4224
+ this.set(presetNameOrOptions || {});
4225
+ }
4226
+ }
4227
+ /**
4228
+ * Set parser options (in the same format as in constructor). Probably, you
4229
+ * will never need it, but you can change options after constructor call.
4230
+ *
4231
+ * __Note:__ To achieve the best possible performance, don't modify a
4232
+ * `markdown-it` instance options on the fly. If you need multiple configurations
4233
+ * it's best to create multiple instances and initialize each with separate
4234
+ * config.
4235
+ *
4236
+ * @example
4237
+ * ```javascript
4238
+ * import MarkdownIt from 'markdown-it'
4239
+ *
4240
+ * const md = new MarkdownIt()
4241
+ * .set({ html: true, breaks: true })
4242
+ * .set({ typographer: true })
4243
+ * ```
4244
+ */
4245
+ set(options) {
4246
+ Object.assign(this.options, options);
4247
+ return this;
4248
+ }
4249
+ /**
4250
+ * Batch load of all options and compenent settings. This is internal method,
4251
+ * and you probably will not need it. But if you will - see available presets
4252
+ * and data structure [here](https://github.com/markdown-it/markdown-it/tree/master/src/presets)
4253
+ *
4254
+ * We strongly recommend to use presets instead of direct config loads. That
4255
+ * will give better compatibility with next versions.
4256
+ */
4257
+ configure(presets) {
4258
+ let p;
4259
+ if (typeof presets === "string") {
4260
+ const presetName = presets;
4261
+ p = config[presetName];
4262
+ if (!p) throw new Error(`Wrong 'markdown-it' preset "${presetName}", check name`);
4263
+ } else p = presets;
4264
+ if (!p) throw new Error("Wrong `markdown-it` preset, can't be empty");
4265
+ if (p.options) this.options = _objectSpread2({}, p.options);
4266
+ const components = p.components;
4267
+ if (components) {
4268
+ var _components$inline;
4269
+ [
4270
+ "core",
4271
+ "block",
4272
+ "inline"
4273
+ ].forEach((name) => {
4274
+ var _components$name;
4275
+ const rules = (_components$name = components[name]) === null || _components$name === void 0 ? void 0 : _components$name.rules;
4276
+ if (rules) this[name].ruler.enableOnly(rules);
4277
+ });
4278
+ const rules2 = (_components$inline = components.inline) === null || _components$inline === void 0 ? void 0 : _components$inline.rules2;
4279
+ if (rules2) this.inline.ruler2.enableOnly(rules2);
4280
+ }
4281
+ return this;
4282
+ }
4283
+ /**
4284
+ * Enable list or rules. It will automatically find appropriate components,
4285
+ * containing rules with given names. If rule not found, and `ignoreInvalid`
4286
+ * not set - throws exception.
4287
+ *
4288
+ * @example
4289
+ * ```javascript
4290
+ * import MarkdownIt from 'markdown-it'
4291
+ *
4292
+ * const md = new MarkdownIt()
4293
+ * .enable(['sub', 'sup'])
4294
+ * .disable('smartquotes')
4295
+ * ```
4296
+ */
4297
+ enable(list, ignoreInvalid = false) {
4298
+ let result = [];
4299
+ if (!Array.isArray(list)) list = [list];
4300
+ [
4301
+ "core",
4302
+ "block",
4303
+ "inline"
4304
+ ].forEach((chain) => {
4305
+ result = result.concat(this[chain].ruler.enable(list, true));
4306
+ });
4307
+ result = result.concat(this.inline.ruler2.enable(list, true));
4308
+ const missed = list.filter((name) => result.indexOf(name) < 0);
4309
+ if (missed.length && !ignoreInvalid) throw new Error(`MarkdownIt. Failed to enable unknown rule(s): ${missed}`);
4310
+ return this;
4311
+ }
4312
+ /**
4313
+ * The same as {@link MarkdownIt.enable}, but turn specified rules off.
4314
+ */
4315
+ disable(list, ignoreInvalid = false) {
4316
+ let result = [];
4317
+ if (!Array.isArray(list)) list = [list];
4318
+ [
4319
+ "core",
4320
+ "block",
4321
+ "inline"
4322
+ ].forEach((chain) => {
4323
+ result = result.concat(this[chain].ruler.disable(list, true));
4324
+ });
4325
+ result = result.concat(this.inline.ruler2.disable(list, true));
4326
+ const missed = list.filter((name) => result.indexOf(name) < 0);
4327
+ if (missed.length && !ignoreInvalid) throw new Error(`MarkdownIt. Failed to disable unknown rule(s): ${missed}`);
4328
+ return this;
4329
+ }
4330
+ /**
4331
+ * Load specified plugin with given params into current parser instance.
4332
+ * It's just a sugar to call `plugin(md, params)` with curring.
4333
+ *
4334
+ * @example
4335
+ * ```javascript
4336
+ * import MarkdownIt from 'markdown-it'
4337
+ * import iterator from 'markdown-it-for-inline'
4338
+ *
4339
+ * const md = new MarkdownIt()
4340
+ * .use(iterator, 'foo_replace', 'text', function (tokens, idx) {
4341
+ * tokens[idx].content = tokens[idx].content.replace(/foo/g, 'bar')
4342
+ * })
4343
+ * ```
4344
+ */
4345
+ use(plugin, ...params) {
4346
+ plugin.apply(plugin, [this, ...params]);
4347
+ return this;
4348
+ }
4349
+ /**
4350
+ * Parse input string and return list of block tokens (special token type
4351
+ * "inline" will contain list of inline tokens). You should not call this
4352
+ * method directly, until you write custom renderer (for example, to produce
4353
+ * AST).
4354
+ *
4355
+ * `env` is used to pass data between "distributed" rules and return additional
4356
+ * metadata like reference info, needed for the renderer. It also can be used to
4357
+ * inject data in specific cases. Usually, you will be ok to pass `{}`,
4358
+ * and then pass updated object to renderer.
4359
+ */
4360
+ parse(src, env) {
4361
+ if (typeof src !== "string") throw new Error("Input data should be a String");
4362
+ const state = new this.core.State(src, this, env);
4363
+ this.core.process(state);
4364
+ return state.tokens;
4365
+ }
4366
+ /**
4367
+ * Render markdown string into html. It does all magic for you :).
4368
+ *
4369
+ * `env` can be used to inject additional metadata (`{}` by default).
4370
+ * But you will not need it with high probability. See also comment
4371
+ * in {@link MarkdownIt.parse}.
4372
+ */
4373
+ render(src, env = {}) {
4374
+ return this.renderer.render(this.parse(src, env), this.options, env);
4375
+ }
4376
+ /**
4377
+ * The same as {@link MarkdownIt.parse} but skip all block rules. It returns
4378
+ * the block tokens list with the single `inline` element, containing parsed
4379
+ * inline tokens in `children` property. Also updates `env` object.
4380
+ */
4381
+ parseInline(src, env) {
4382
+ const state = new this.core.State(src, this, env);
4383
+ state.inlineMode = true;
4384
+ this.core.process(state);
4385
+ return state.tokens;
4386
+ }
4387
+ /**
4388
+ * Similar to {@link MarkdownIt.render} but for single paragraph content.
4389
+ * Result will NOT be wrapped into `<p>` tags.
4390
+ */
4391
+ renderInline(src, env = {}) {
4392
+ return this.renderer.render(this.parseInline(src, env), this.options, env);
4393
+ }
4394
+ };
4395
+ _defineProperty(MarkdownIt, "Token", Token);
4396
+ _defineProperty(MarkdownIt, "Ruler", Ruler);
4397
+ _defineProperty(MarkdownIt, "Renderer", Renderer);
4398
+ _defineProperty(MarkdownIt, "ParserCore", ParserCore);
4399
+ _defineProperty(MarkdownIt, "StateCore", StateCore);
4400
+ _defineProperty(MarkdownIt, "ParserBlock", ParserBlock);
4401
+ _defineProperty(MarkdownIt, "StateBlock", StateBlock);
4402
+ _defineProperty(MarkdownIt, "ParserInline", ParserInline);
4403
+ _defineProperty(MarkdownIt, "StateInline", StateInline);
4404
+ //#endregion
4405
+ //#region src/index.ts
4406
+ /**
4407
+ * Default package export.
4408
+ *
4409
+ * For backward compatibility, the {@link MarkdownIt} class is wrapped so
4410
+ * legacy code can call it without `new`. New code should instantiate it as a
4411
+ * regular class with `new`. The compatibility wrapper may be removed in a
4412
+ * future release.
4413
+ *
4414
+ * @category Main
4415
+ */
4416
+ var MarkdownItCallable = callable(MarkdownIt);
4417
+ //#endregion
4418
+ module.exports = MarkdownItCallable;
4419
+
4420
+ //# sourceMappingURL=markdown-it.cjs.js.map