@rspress/core 2.0.0-rc.0 → 2.0.0-rc.2

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 (298) hide show
  1. package/bin/rspress.js +1 -1
  2. package/dist/0~7675.989ee664.js +1791 -0
  3. package/dist/1218.3869bad6.js +2 -0
  4. package/dist/4669.12208c6a.js +2 -0
  5. package/dist/5313.6594aba0.js +63 -0
  6. package/dist/5485.2a0273cf.js +98 -0
  7. package/dist/6289.c67fe0d5.js +5 -0
  8. package/dist/7805.cadab34e.js +4 -0
  9. package/dist/8813.9da1f210.js +2 -0
  10. package/dist/cli/config/index.js +4 -0
  11. package/dist/cli/config/loadConfigFile.js +30 -0
  12. package/dist/cli/index.cb89dbd1.js +3 -0
  13. package/dist/cli/index.js +122 -0
  14. package/dist/eject-theme/components/Banner/index.tsx +3 -4
  15. package/dist/eject-theme/components/Button/index.scss +1 -6
  16. package/dist/eject-theme/components/Callout/index.scss +0 -2
  17. package/dist/eject-theme/components/CodeBlock/index.scss +4 -12
  18. package/dist/eject-theme/components/CodeBlock/index.tsx +6 -1
  19. package/dist/eject-theme/components/CodeButtonGroup/CopyCodeButton.tsx +1 -3
  20. package/dist/eject-theme/components/CodeButtonGroup/index.scss +5 -1
  21. package/dist/eject-theme/components/CodeButtonGroup/index.tsx +1 -3
  22. package/dist/eject-theme/components/DocContent/doc.scss +30 -9
  23. package/dist/eject-theme/components/DocContent/docComponents/table.tsx +10 -4
  24. package/dist/eject-theme/components/DocContent/index.tsx +5 -2
  25. package/dist/eject-theme/components/{DocContent/FallbackHeading.tsx → FallbackHeading/index.tsx} +20 -11
  26. package/dist/eject-theme/components/HoverGroup/index.scss +5 -1
  27. package/dist/eject-theme/components/HoverGroup/index.tsx +5 -1
  28. package/dist/eject-theme/components/Link/index.tsx +43 -9
  29. package/dist/eject-theme/components/Link/useLinkNavigate.ts +32 -16
  30. package/dist/eject-theme/components/Nav/NavMenu.scss +1 -0
  31. package/dist/eject-theme/components/Nav/NavMenu.tsx +2 -3
  32. package/dist/eject-theme/components/Nav/NavTitle.scss +11 -0
  33. package/dist/eject-theme/components/Nav/NavTitle.tsx +1 -0
  34. package/dist/eject-theme/components/Nav/index.scss +0 -8
  35. package/dist/eject-theme/components/NavHamburger/index.tsx +3 -4
  36. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.scss +14 -0
  37. package/dist/eject-theme/components/NavScreen/NavScreenMenuItem.tsx +2 -3
  38. package/dist/eject-theme/components/Outline/index.scss +0 -1
  39. package/dist/eject-theme/components/Overview/OverviewGroup.tsx +1 -2
  40. package/dist/eject-theme/components/Overview/index.tsx +6 -2
  41. package/dist/eject-theme/components/PackageManagerTabs/index.tsx +12 -0
  42. package/dist/eject-theme/components/PrevNextPage/index.tsx +6 -3
  43. package/dist/eject-theme/components/Root/index.tsx +58 -0
  44. package/dist/eject-theme/components/Search/NoSearchResult.tsx +2 -3
  45. package/dist/eject-theme/components/Search/SearchButton.tsx +3 -4
  46. package/dist/eject-theme/components/Search/SearchPanel.tsx +14 -9
  47. package/dist/eject-theme/components/Search/SuggestItem.tsx +15 -12
  48. package/dist/eject-theme/components/Sidebar/SidebarGroup.tsx +2 -3
  49. package/dist/eject-theme/components/Sidebar/SidebarItem.scss +12 -8
  50. package/dist/eject-theme/components/Sidebar/SidebarItem.tsx +6 -4
  51. package/dist/eject-theme/components/Sidebar/SidebarSectionHeader.scss +1 -1
  52. package/dist/eject-theme/components/SidebarMenu/index.tsx +4 -4
  53. package/dist/eject-theme/components/SocialLinks/index.tsx +2 -3
  54. package/dist/eject-theme/components/SourceCode/index.scss +2 -1
  55. package/dist/eject-theme/components/SourceCode/index.tsx +6 -4
  56. package/dist/eject-theme/components/SwitchAppearance/index.tsx +3 -5
  57. package/dist/eject-theme/components/Tabs/index.scss +19 -22
  58. package/dist/eject-theme/components/Toc/TocItem.scss +8 -4
  59. package/dist/eject-theme/components/Toc/TocItem.tsx +1 -0
  60. package/dist/index.d.ts +6 -6
  61. package/dist/index.js +16 -3134
  62. package/dist/node/PluginDriver.d.ts +1 -1
  63. package/dist/node/PluginDriver.js +143 -0
  64. package/dist/node/auto-nav-sidebar/index.js +44 -0
  65. package/dist/node/auto-nav-sidebar/locales.js +26 -0
  66. package/dist/node/auto-nav-sidebar/normalize.js +228 -0
  67. package/dist/node/auto-nav-sidebar/utils.js +68 -0
  68. package/dist/node/auto-nav-sidebar/walk.js +67 -0
  69. package/dist/node/build.js +31 -0
  70. package/dist/node/constants.d.ts +1 -0
  71. package/dist/node/constants.js +33 -0
  72. package/dist/node/dev.js +32 -0
  73. package/dist/node/eject.js +111 -0
  74. package/dist/node/index.d.ts +5 -5
  75. package/dist/node/initRsbuild.d.ts +2 -2
  76. package/dist/node/initRsbuild.js +338 -0
  77. package/dist/node/last-updated/index.js +28 -0
  78. package/dist/node/logger/hint.d.ts +1 -1
  79. package/dist/node/logger/hint.js +85 -0
  80. package/dist/node/mdx/loader.d.ts +1 -1
  81. package/dist/node/mdx/loader.e1578c62.js +13 -0
  82. package/dist/{loader.js → node/mdx/loader.js} +2 -2
  83. package/dist/node/mdx/options.d.ts +2 -2
  84. package/dist/node/mdx/options.js +100 -0
  85. package/dist/node/mdx/processor.d.ts +2 -2
  86. package/dist/node/mdx/processor.js +71 -0
  87. package/dist/node/mdx/rehypePlugins/codeMeta.js +10 -0
  88. package/dist/node/mdx/rehypePlugins/headerAnchor.js +53 -0
  89. package/dist/node/mdx/rehypePlugins/shiki.js +34 -0
  90. package/dist/node/mdx/rehypePlugins/transformers/add-lang.js +15 -0
  91. package/dist/node/mdx/rehypePlugins/transformers/add-line-numbers.js +22 -0
  92. package/dist/node/mdx/rehypePlugins/transformers/add-title.js +24 -0
  93. package/dist/node/mdx/rehypePlugins/transformers/add-wrap-code.js +22 -0
  94. package/dist/node/mdx/rehypePlugins/transformers/index.d.ts +5 -5
  95. package/dist/node/mdx/rehypePlugins/transformers/index.js +5 -0
  96. package/dist/node/mdx/rehypePlugins/transformers/meta-highlight.js +41 -0
  97. package/dist/node/mdx/remarkPlugins/builtin.js +11 -0
  98. package/dist/node/mdx/remarkPlugins/containerSyntax.js +190 -0
  99. package/dist/node/mdx/remarkPlugins/fileCodeBlock.js +66 -0
  100. package/dist/node/mdx/remarkPlugins/image.js +67 -0
  101. package/dist/node/mdx/remarkPlugins/link.d.ts +1 -1
  102. package/dist/node/mdx/remarkPlugins/link.js +99 -0
  103. package/dist/node/mdx/remarkPlugins/toc.js +50 -0
  104. package/dist/node/mdx/types.d.ts +3 -3
  105. package/dist/node/medium-zoom/index.d.ts +1 -1
  106. package/dist/node/medium-zoom/index.js +14 -0
  107. package/dist/node/route/RoutePage.d.ts +1 -1
  108. package/dist/node/route/RoutePage.js +61 -0
  109. package/dist/node/route/RouteService.d.ts +1 -1
  110. package/dist/node/route/RouteService.js +177 -0
  111. package/dist/node/route/extractPageData.d.ts +1 -1
  112. package/dist/node/route/extractPageData.js +112 -0
  113. package/dist/node/route/normalizeRoutePath.js +54 -0
  114. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.d.ts +21 -0
  115. package/dist/node/runtimeModule/DEFAULT_I18N_TEXT.js +150 -0
  116. package/dist/node/runtimeModule/globalStyles.d.ts +1 -1
  117. package/dist/node/runtimeModule/globalStyles.js +12 -0
  118. package/dist/node/runtimeModule/globalUIComponents.d.ts +1 -1
  119. package/dist/node/runtimeModule/globalUIComponents.js +25 -0
  120. package/dist/node/runtimeModule/i18n.d.ts +2 -2
  121. package/dist/node/runtimeModule/i18n.js +83 -0
  122. package/dist/node/runtimeModule/pageData/createPageData.d.ts +1 -1
  123. package/dist/node/runtimeModule/pageData/createPageData.js +64 -0
  124. package/dist/node/runtimeModule/pageData/rsbuildPlugin.d.ts +1 -1
  125. package/dist/node/runtimeModule/pageData/rsbuildPlugin.js +51 -0
  126. package/dist/node/runtimeModule/routeList.d.ts +1 -1
  127. package/dist/node/runtimeModule/routeList.js +7 -0
  128. package/dist/node/runtimeModule/searchHooks.d.ts +1 -1
  129. package/dist/node/runtimeModule/searchHooks.js +11 -0
  130. package/dist/node/runtimeModule/siteData/createSiteData.js +34 -0
  131. package/dist/node/runtimeModule/siteData/normalizeThemeConfig.js +94 -0
  132. package/dist/node/runtimeModule/siteData/rsbuildPlugin.d.ts +1 -1
  133. package/dist/node/runtimeModule/siteData/rsbuildPlugin.js +24 -0
  134. package/dist/node/runtimeModule/socialLinks.d.ts +1 -1
  135. package/dist/node/runtimeModule/socialLinks.js +8 -0
  136. package/dist/node/runtimeModule/types.d.ts +2 -2
  137. package/dist/node/serve.js +23 -0
  138. package/dist/node/ssg/renderHtmlTemplate.js +33 -0
  139. package/dist/node/ssg/renderPage.js +34 -0
  140. package/dist/node/ssg/renderPageWorker.474f9f73.js +2 -0
  141. package/dist/node/ssg/renderPageWorker.js +15 -0
  142. package/dist/node/ssg/renderPages.d.ts +1 -1
  143. package/dist/node/ssg/renderPages.js +105 -0
  144. package/dist/node/ssg/renderPages.js.LICENSE.txt +4 -0
  145. package/dist/node/ssg/rsbuildPluginCSR.d.ts +1 -1
  146. package/dist/node/ssg/rsbuildPluginCSR.js +27 -0
  147. package/dist/node/ssg/rsbuildPluginSSG.d.ts +1 -1
  148. package/dist/node/ssg/rsbuildPluginSSG.js +72 -0
  149. package/dist/node/ssg/ssgEnv.js +33 -0
  150. package/dist/node/ssg/ssgEnv.js.LICENSE.txt +5 -0
  151. package/dist/node/ssg-md/llms/emitLlmsTxt.d.ts +1 -1
  152. package/dist/node/ssg-md/llms/emitLlmsTxt.js +80 -0
  153. package/dist/node/ssg-md/llms/llmsTxt.d.ts +1 -1
  154. package/dist/node/ssg-md/llms/llmsTxt.js +66 -0
  155. package/dist/node/ssg-md/react/index.d.ts +1 -1
  156. package/dist/node/ssg-md/remarkSplitMdx.js +202 -0
  157. package/dist/node/ssg-md/renderPage.js +31 -0
  158. package/dist/node/ssg-md/renderPages.d.ts +1 -1
  159. package/dist/node/ssg-md/renderPages.js +27 -0
  160. package/dist/node/ssg-md/rsbuildPluginSSGMD.d.ts +1 -1
  161. package/dist/node/ssg-md/rsbuildPluginSSGMD.js +47 -0
  162. package/dist/node/utils/applyReplaceRules.js +6 -0
  163. package/dist/node/utils/checkLanguageParity.js +77 -0
  164. package/dist/node/utils/createHash.js +5 -0
  165. package/dist/node/utils/error.d.ts +9 -0
  166. package/dist/node/utils/error.js +9 -0
  167. package/dist/node/utils/escapeHeadingIds.js +5 -0
  168. package/dist/node/utils/flattenMdxContent.js +74 -0
  169. package/dist/node/utils/fs.js +14 -0
  170. package/dist/node/utils/getImportAstNode.js +63 -0
  171. package/dist/node/utils/getPageKey.js +6 -0
  172. package/dist/node/utils/getSocialIcons.js +32 -0
  173. package/dist/node/utils/index.d.ts +10 -9
  174. package/dist/node/utils/normalizePath.js +10 -0
  175. package/dist/node/utils/reactAlias.d.ts +2 -0
  176. package/dist/node/utils/reactAlias.js +83 -0
  177. package/dist/rslib-runtime.99091bf6.js +18 -0
  178. package/dist/runtime/App.js +2 -2
  179. package/dist/runtime/ClientApp.d.ts +1 -1
  180. package/dist/runtime/ClientApp.js +0 -4
  181. package/dist/runtime/ssrMdServerEntry.js +1 -1
  182. package/dist/runtime/ssrServerEntry.js +2 -1
  183. package/dist/runtime.72d450ac.js +1 -0
  184. package/dist/runtime.js +3 -2
  185. package/dist/shiki-transformers.d.ts +1 -1
  186. package/dist/shiki-transformers.js +6 -120
  187. package/dist/theme/assets/moon.js +9 -26
  188. package/dist/theme/components/Banner/index.d.ts +1 -1
  189. package/dist/theme/components/Banner/index.js +2 -3
  190. package/dist/theme/components/Button/index.css +1 -1
  191. package/dist/theme/components/Callout/index.css +0 -2
  192. package/dist/theme/components/CodeBlock/index.css +4 -15
  193. package/dist/theme/components/CodeBlock/index.js +1 -0
  194. package/dist/theme/components/CodeButtonGroup/CopyCodeButton.js +3 -5
  195. package/dist/theme/components/CodeButtonGroup/index.css +5 -1
  196. package/dist/theme/components/CodeButtonGroup/index.js +3 -5
  197. package/dist/theme/components/DocContent/doc.css +30 -8
  198. package/dist/theme/components/DocContent/docComponents/index.d.ts +3 -3
  199. package/dist/theme/components/DocContent/docComponents/table.d.ts +2 -2
  200. package/dist/theme/components/DocContent/docComponents/table.js +8 -3
  201. package/dist/theme/components/DocContent/index.js +3 -2
  202. package/dist/theme/components/{DocContent/FallbackHeading.js → FallbackHeading/index.js} +19 -11
  203. package/dist/theme/components/HoverGroup/index.css +5 -1
  204. package/dist/theme/components/HoverGroup/index.js +1 -0
  205. package/dist/theme/components/HoverGroup/useHoverGroup.d.ts +1 -1
  206. package/dist/theme/components/Link/index.d.ts +18 -1
  207. package/dist/theme/components/Link/index.js +14 -8
  208. package/dist/theme/components/Link/useLinkNavigate.d.ts +4 -1
  209. package/dist/theme/components/Link/useLinkNavigate.js +23 -17
  210. package/dist/theme/components/Nav/NavMenu.css +1 -0
  211. package/dist/theme/components/Nav/NavMenu.js +2 -3
  212. package/dist/theme/components/Nav/NavTitle.css +12 -0
  213. package/dist/theme/components/Nav/NavTitle.d.ts +1 -0
  214. package/dist/theme/components/Nav/NavTitle.js +1 -0
  215. package/dist/theme/components/Nav/index.css +0 -8
  216. package/dist/theme/components/NavHamburger/index.js +3 -4
  217. package/dist/theme/components/NavScreen/NavScreenMenuItem.css +9 -0
  218. package/dist/theme/components/NavScreen/NavScreenMenuItem.js +2 -3
  219. package/dist/theme/components/Outline/index.css +0 -1
  220. package/dist/theme/components/Overview/OverviewGroup.js +1 -2
  221. package/dist/theme/components/Overview/index.js +1 -2
  222. package/dist/theme/components/PackageManagerTabs/index.d.ts +1 -1
  223. package/dist/theme/components/PackageManagerTabs/index.js +4 -0
  224. package/dist/theme/components/PrevNextPage/index.js +3 -4
  225. package/dist/theme/components/Root/index.d.ts +54 -0
  226. package/dist/theme/components/Root/index.js +7 -0
  227. package/dist/theme/components/Search/NoSearchResult.js +2 -3
  228. package/dist/theme/components/Search/SearchButton.js +3 -4
  229. package/dist/theme/components/Search/SearchPanel.js +13 -16
  230. package/dist/theme/components/Search/SuggestItem.d.ts +1 -1
  231. package/dist/theme/components/Search/SuggestItem.js +7 -11
  232. package/dist/theme/components/Search/logic/Provider.d.ts +1 -1
  233. package/dist/theme/components/Search/logic/providers/LocalProvider.d.ts +2 -2
  234. package/dist/theme/components/Search/logic/search.d.ts +1 -1
  235. package/dist/theme/components/Sidebar/SidebarGroup.js +2 -3
  236. package/dist/theme/components/Sidebar/SidebarItem.css +11 -3
  237. package/dist/theme/components/Sidebar/SidebarItem.js +6 -3
  238. package/dist/theme/components/Sidebar/SidebarSectionHeader.css +1 -1
  239. package/dist/theme/components/SidebarMenu/index.js +3 -5
  240. package/dist/theme/components/SocialLinks/index.js +2 -3
  241. package/dist/theme/components/SourceCode/index.css +5 -0
  242. package/dist/theme/components/SourceCode/index.js +2 -4
  243. package/dist/theme/components/SwitchAppearance/index.js +3 -5
  244. package/dist/theme/components/Tabs/index.css +13 -22
  245. package/dist/theme/components/Toc/TocItem.css +7 -4
  246. package/dist/theme/components/Toc/TocItem.js +1 -0
  247. package/dist/theme/icons.d.ts +25 -0
  248. package/dist/theme/icons.js +47 -0
  249. package/dist/theme/index.d.ts +62 -59
  250. package/dist/theme/index.js +5 -2
  251. package/dist/theme/layout/DocLayout/index.css +2 -2
  252. package/dist/theme/layout/DocLayout/index.js +1 -4
  253. package/dist/theme/layout/Layout/index.d.ts +1 -1
  254. package/dist/theme/layout/Layout/index.js +3 -3
  255. package/dist/theme/logic/useFullTextSearch.d.ts +1 -1
  256. package/dist/theme/logic/useScrollAfterNav.d.ts +5 -0
  257. package/dist/theme/logic/{sideEffects.js → useScrollAfterNav.js} +5 -6
  258. package/dist/theme/logic/useScrollReset.d.ts +5 -0
  259. package/dist/theme/logic/useScrollReset.js +12 -0
  260. package/dist/theme/logic/useSetup.js +2 -0
  261. package/dist/theme/styles/base.css +1 -10
  262. package/dist/theme/styles/index.d.ts +1 -1
  263. package/dist/theme/styles/index.js +1 -1
  264. package/dist/theme/styles/scrollbar.css +1 -0
  265. package/dist/theme/styles/vars/base-vars.css +5 -3
  266. package/dist/theme/styles/vars/home-vars.css +4 -2
  267. package/package.json +19 -20
  268. package/dist/3~101.js +0 -1786
  269. package/dist/3~335.js +0 -26
  270. package/dist/3~395.js +0 -74
  271. package/dist/cli.js +0 -259
  272. package/dist/index.js.LICENSE.txt +0 -10
  273. package/dist/node/auto-nav-sidebar/fixtures/docs/guide/c.d.ts +0 -2
  274. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/en/guide/c.d.ts +0 -2
  275. package/dist/node/auto-nav-sidebar/fixtures/docs-locales/zh/guide/c.d.ts +0 -2
  276. package/dist/node/auto-nav-sidebar/locales.test.d.ts +0 -1
  277. package/dist/node/auto-nav-sidebar/walk.test.d.ts +0 -1
  278. package/dist/node/mdx/rehypePlugins/headerAnchor.test.d.ts +0 -1
  279. package/dist/node/mdx/remarkPlugins/containerSyntax.test.d.ts +0 -1
  280. package/dist/node/mdx/remarkPlugins/fileCodeBlock.test.d.ts +0 -1
  281. package/dist/node/mdx/remarkPlugins/image.test.d.ts +0 -1
  282. package/dist/node/mdx/remarkPlugins/link.test.d.ts +0 -1
  283. package/dist/node/route/RouteService.test.d.ts +0 -1
  284. package/dist/node/route/extractPageData.test.d.ts +0 -1
  285. package/dist/node/route/fixtures/basic/guide/c.d.ts +0 -2
  286. package/dist/node/route/normalizeRoutePath.test.d.ts +0 -1
  287. package/dist/node/runtimeModule/i18n.test.d.ts +0 -1
  288. package/dist/node/ssg-md/remarkSplitMdx.test.d.ts +0 -4
  289. package/dist/node/utils/checkLanguageParity.test.d.ts +0 -1
  290. package/dist/node/utils/detectCustomIcon.d.ts +0 -1
  291. package/dist/node/utils/detectReactVersion.d.ts +0 -3
  292. package/dist/processor.js +0 -4539
  293. package/dist/renderPageWorker.js +0 -196
  294. package/dist/theme/components/Search/logic/util.test.d.ts +0 -1
  295. /package/dist/cli/{config.d.ts → config/index.d.ts} +0 -0
  296. /package/dist/{shiki-transformers.js.LICENSE.txt → node/mdx/rehypePlugins/transformers/meta-highlight.js.LICENSE.txt} +0 -0
  297. /package/dist/theme/components/{DocContent/FallbackHeading.d.ts → FallbackHeading/index.d.ts} +0 -0
  298. /package/dist/theme/logic/{sideEffects.d.ts → useSetup.d.ts} +0 -0
package/dist/processor.js DELETED
@@ -1,4539 +0,0 @@
1
- import node_path from "node:path";
2
- import { createProcessor, nodeTypes } from "@mdx-js/mdx";
3
- import { extractTextAndId, getNodeAttribute, loadFrontMatter } from "@rspress/shared/node-utils";
4
- import node_os from "node:os";
5
- import rehype from "@shikijs/rehype";
6
- import rehype_external_links from "rehype-external-links";
7
- import rehype_raw from "rehype-raw";
8
- import remark_gfm from "remark-gfm";
9
- import remark_mdx from "remark-mdx";
10
- import { EXIT, visit } from "unist-util-visit";
11
- import { unified } from "unified";
12
- import github_slugger from "github-slugger";
13
- import { headingRank } from "hast-util-heading-rank";
14
- import { createCssVariablesTheme } from "shiki";
15
- import { readFile as promises_readFile } from "node:fs/promises";
16
- import { logger as logger_logger } from "@rspress/shared/logger";
17
- import picocolors_0 from "picocolors";
18
- import { addLeadingSlash, isExternalUrl, isProduction, normalizeHref, parseUrl, withBase } from "@rspress/shared";
19
- import { visitChildren } from "unist-util-visit-children";
20
- function applyReplaceRules(code = '', replaceRules = []) {
21
- let result = code;
22
- for (const rule of replaceRules)result = result.replace(rule.search, rule.replace);
23
- return result;
24
- }
25
- function escapeMarkdownHeadingIds(content) {
26
- const markdownHeadingRegexp = /(?:^|\n)#{1,6}(?!#).*/g;
27
- return content.replace(markdownHeadingRegexp, (substring)=>substring.replace('{#', '\\{#').replace('\\\\{#', '\\{#'));
28
- }
29
- const isWindows = 'win32' === node_os.platform();
30
- function slash(p) {
31
- return p.replace(/\\/g, '/');
32
- }
33
- function normalizePath(id) {
34
- return node_path.posix.normalize(isWindows ? slash(id) : id);
35
- }
36
- const own = {}.hasOwnProperty;
37
- function zwitch(key, options) {
38
- const settings = options || {};
39
- function one(value, ...parameters) {
40
- let fn = one.invalid;
41
- const handlers = one.handlers;
42
- if (value && own.call(value, key)) {
43
- const id = String(value[key]);
44
- fn = own.call(handlers, id) ? handlers[id] : one.unknown;
45
- }
46
- if (fn) return fn.call(this, value, ...parameters);
47
- }
48
- one.handlers = settings.handlers || {};
49
- one.invalid = settings.invalid;
50
- one.unknown = settings.unknown;
51
- return one;
52
- }
53
- const configure_own = {}.hasOwnProperty;
54
- function configure(base, extension) {
55
- let index = -1;
56
- let key;
57
- if (extension.extensions) while(++index < extension.extensions.length)configure(base, extension.extensions[index]);
58
- for(key in extension)if (configure_own.call(extension, key)) switch(key){
59
- case 'extensions':
60
- break;
61
- case 'unsafe':
62
- configure_list(base[key], extension[key]);
63
- break;
64
- case 'join':
65
- configure_list(base[key], extension[key]);
66
- break;
67
- case 'handlers':
68
- configure_map(base[key], extension[key]);
69
- break;
70
- default:
71
- base.options[key] = extension[key];
72
- }
73
- return base;
74
- }
75
- function configure_list(left, right) {
76
- if (right) left.push(...right);
77
- }
78
- function configure_map(left, right) {
79
- if (right) Object.assign(left, right);
80
- }
81
- function blockquote(node, _, state, info) {
82
- const exit = state.enter('blockquote');
83
- const tracker = state.createTracker(info);
84
- tracker.move('> ');
85
- tracker.shift(2);
86
- const value = state.indentLines(state.containerFlow(node, tracker.current()), blockquote_map);
87
- exit();
88
- return value;
89
- }
90
- function blockquote_map(line, _, blank) {
91
- return '>' + (blank ? '' : ' ') + line;
92
- }
93
- function patternInScope(stack, pattern) {
94
- return listInScope(stack, pattern.inConstruct, true) && !listInScope(stack, pattern.notInConstruct, false);
95
- }
96
- function listInScope(stack, list, none) {
97
- if ('string' == typeof list) list = [
98
- list
99
- ];
100
- if (!list || 0 === list.length) return none;
101
- let index = -1;
102
- while(++index < list.length)if (stack.includes(list[index])) return true;
103
- return false;
104
- }
105
- function hardBreak(_, _1, state, info) {
106
- let index = -1;
107
- while(++index < state.unsafe.length)if ('\n' === state.unsafe[index].character && patternInScope(state.stack, state.unsafe[index])) return /[ \t]/.test(info.before) ? '' : ' ';
108
- return '\\\n';
109
- }
110
- function longestStreak(value, substring) {
111
- const source = String(value);
112
- let index = source.indexOf(substring);
113
- let expected = index;
114
- let count = 0;
115
- let max = 0;
116
- if ('string' != typeof substring) throw new TypeError('Expected substring');
117
- while(-1 !== index){
118
- if (index === expected) {
119
- if (++count > max) max = count;
120
- } else count = 1;
121
- expected = index + substring.length;
122
- index = source.indexOf(substring, expected);
123
- }
124
- return max;
125
- }
126
- function formatCodeAsIndented(node, state) {
127
- return Boolean(false === state.options.fences && node.value && !node.lang && /[^ \r\n]/.test(node.value) && !/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(node.value));
128
- }
129
- function checkFence(state) {
130
- const marker = state.options.fence || '`';
131
- if ('`' !== marker && '~' !== marker) throw new Error('Cannot serialize code with `' + marker + '` for `options.fence`, expected `` ` `` or `~`');
132
- return marker;
133
- }
134
- function code_code(node, _, state, info) {
135
- const marker = checkFence(state);
136
- const raw = node.value || '';
137
- const suffix = '`' === marker ? 'GraveAccent' : 'Tilde';
138
- if (formatCodeAsIndented(node, state)) {
139
- const exit = state.enter('codeIndented');
140
- const value = state.indentLines(raw, code_map);
141
- exit();
142
- return value;
143
- }
144
- const tracker = state.createTracker(info);
145
- const sequence = marker.repeat(Math.max(longestStreak(raw, marker) + 1, 3));
146
- const exit = state.enter('codeFenced');
147
- let value = tracker.move(sequence);
148
- if (node.lang) {
149
- const subexit = state.enter(`codeFencedLang${suffix}`);
150
- value += tracker.move(state.safe(node.lang, {
151
- before: value,
152
- after: ' ',
153
- encode: [
154
- '`'
155
- ],
156
- ...tracker.current()
157
- }));
158
- subexit();
159
- }
160
- if (node.lang && node.meta) {
161
- const subexit = state.enter(`codeFencedMeta${suffix}`);
162
- value += tracker.move(' ');
163
- value += tracker.move(state.safe(node.meta, {
164
- before: value,
165
- after: '\n',
166
- encode: [
167
- '`'
168
- ],
169
- ...tracker.current()
170
- }));
171
- subexit();
172
- }
173
- value += tracker.move('\n');
174
- if (raw) value += tracker.move(raw + '\n');
175
- value += tracker.move(sequence);
176
- exit();
177
- return value;
178
- }
179
- function code_map(line, _, blank) {
180
- return (blank ? '' : ' ') + line;
181
- }
182
- function checkQuote(state) {
183
- const marker = state.options.quote || '"';
184
- if ('"' !== marker && "'" !== marker) throw new Error('Cannot serialize title with `' + marker + '` for `options.quote`, expected `"`, or `\'`');
185
- return marker;
186
- }
187
- function definition(node, _, state, info) {
188
- const quote = checkQuote(state);
189
- const suffix = '"' === quote ? 'Quote' : 'Apostrophe';
190
- const exit = state.enter('definition');
191
- let subexit = state.enter('label');
192
- const tracker = state.createTracker(info);
193
- let value = tracker.move('[');
194
- value += tracker.move(state.safe(state.associationId(node), {
195
- before: value,
196
- after: ']',
197
- ...tracker.current()
198
- }));
199
- value += tracker.move(']: ');
200
- subexit();
201
- if (!node.url || /[\0- \u007F]/.test(node.url)) {
202
- subexit = state.enter('destinationLiteral');
203
- value += tracker.move('<');
204
- value += tracker.move(state.safe(node.url, {
205
- before: value,
206
- after: '>',
207
- ...tracker.current()
208
- }));
209
- value += tracker.move('>');
210
- } else {
211
- subexit = state.enter('destinationRaw');
212
- value += tracker.move(state.safe(node.url, {
213
- before: value,
214
- after: node.title ? ' ' : '\n',
215
- ...tracker.current()
216
- }));
217
- }
218
- subexit();
219
- if (node.title) {
220
- subexit = state.enter(`title${suffix}`);
221
- value += tracker.move(' ' + quote);
222
- value += tracker.move(state.safe(node.title, {
223
- before: value,
224
- after: quote,
225
- ...tracker.current()
226
- }));
227
- value += tracker.move(quote);
228
- subexit();
229
- }
230
- exit();
231
- return value;
232
- }
233
- function checkEmphasis(state) {
234
- const marker = state.options.emphasis || '*';
235
- if ('*' !== marker && '_' !== marker) throw new Error('Cannot serialize emphasis with `' + marker + '` for `options.emphasis`, expected `*`, or `_`');
236
- return marker;
237
- }
238
- function encodeCharacterReference(code) {
239
- return '&#x' + code.toString(16).toUpperCase() + ';';
240
- }
241
- regexCheck(/[A-Za-z]/);
242
- regexCheck(/[\dA-Za-z]/);
243
- regexCheck(/[#-'*+\--9=?A-Z^-~]/);
244
- regexCheck(/\d/);
245
- regexCheck(/[\dA-Fa-f]/);
246
- regexCheck(/[!-/:-@[-`{-~]/);
247
- function markdownLineEndingOrSpace(code) {
248
- return null !== code && (code < 0 || 32 === code);
249
- }
250
- const unicodePunctuation = regexCheck(/\p{P}|\p{S}/u);
251
- const unicodeWhitespace = regexCheck(/\s/);
252
- function regexCheck(regex) {
253
- return check;
254
- function check(code) {
255
- return null !== code && code > -1 && regex.test(String.fromCharCode(code));
256
- }
257
- }
258
- function classifyCharacter(code) {
259
- if (null === code || markdownLineEndingOrSpace(code) || unicodeWhitespace(code)) return 1;
260
- if (unicodePunctuation(code)) return 2;
261
- }
262
- function encodeInfo(outside, inside, marker) {
263
- const outsideKind = classifyCharacter(outside);
264
- const insideKind = classifyCharacter(inside);
265
- if (void 0 === outsideKind) return void 0 === insideKind ? '_' === marker ? {
266
- inside: true,
267
- outside: true
268
- } : {
269
- inside: false,
270
- outside: false
271
- } : 1 === insideKind ? {
272
- inside: true,
273
- outside: true
274
- } : {
275
- inside: false,
276
- outside: true
277
- };
278
- if (1 === outsideKind) return void 0 === insideKind ? {
279
- inside: false,
280
- outside: false
281
- } : 1 === insideKind ? {
282
- inside: true,
283
- outside: true
284
- } : {
285
- inside: false,
286
- outside: false
287
- };
288
- return void 0 === insideKind ? {
289
- inside: false,
290
- outside: false
291
- } : 1 === insideKind ? {
292
- inside: true,
293
- outside: false
294
- } : {
295
- inside: false,
296
- outside: false
297
- };
298
- }
299
- emphasis.peek = emphasisPeek;
300
- function emphasis(node, _, state, info) {
301
- const marker = checkEmphasis(state);
302
- const exit = state.enter('emphasis');
303
- const tracker = state.createTracker(info);
304
- const before = tracker.move(marker);
305
- let between = tracker.move(state.containerPhrasing(node, {
306
- after: marker,
307
- before,
308
- ...tracker.current()
309
- }));
310
- const betweenHead = between.charCodeAt(0);
311
- const open = encodeInfo(info.before.charCodeAt(info.before.length - 1), betweenHead, marker);
312
- if (open.inside) between = encodeCharacterReference(betweenHead) + between.slice(1);
313
- const betweenTail = between.charCodeAt(between.length - 1);
314
- const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
315
- if (close.inside) between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
316
- const after = tracker.move(marker);
317
- exit();
318
- state.attentionEncodeSurroundingInfo = {
319
- after: close.outside,
320
- before: open.outside
321
- };
322
- return before + between + after;
323
- }
324
- function emphasisPeek(_, _1, state) {
325
- return state.options.emphasis || '*';
326
- }
327
- const emptyOptions = {};
328
- function lib_toString(value, options) {
329
- const settings = options || emptyOptions;
330
- const includeImageAlt = 'boolean' == typeof settings.includeImageAlt ? settings.includeImageAlt : true;
331
- const includeHtml = 'boolean' == typeof settings.includeHtml ? settings.includeHtml : true;
332
- return lib_one(value, includeImageAlt, includeHtml);
333
- }
334
- function lib_one(value, includeImageAlt, includeHtml) {
335
- if (lib_node(value)) {
336
- if ('value' in value) return 'html' !== value.type || includeHtml ? value.value : '';
337
- if (includeImageAlt && 'alt' in value && value.alt) return value.alt;
338
- if ('children' in value) return lib_all(value.children, includeImageAlt, includeHtml);
339
- }
340
- if (Array.isArray(value)) return lib_all(value, includeImageAlt, includeHtml);
341
- return '';
342
- }
343
- function lib_all(values, includeImageAlt, includeHtml) {
344
- const result = [];
345
- let index = -1;
346
- while(++index < values.length)result[index] = lib_one(values[index], includeImageAlt, includeHtml);
347
- return result.join('');
348
- }
349
- function lib_node(value) {
350
- return Boolean(value && 'object' == typeof value);
351
- }
352
- function formatHeadingAsSetext(node, state) {
353
- let literalWithBreak = false;
354
- visit(node, function(node) {
355
- if ('value' in node && /\r?\n|\r/.test(node.value) || 'break' === node.type) {
356
- literalWithBreak = true;
357
- return EXIT;
358
- }
359
- });
360
- return Boolean((!node.depth || node.depth < 3) && lib_toString(node) && (state.options.setext || literalWithBreak));
361
- }
362
- function heading(node, _, state, info) {
363
- const rank = Math.max(Math.min(6, node.depth || 1), 1);
364
- const tracker = state.createTracker(info);
365
- if (formatHeadingAsSetext(node, state)) {
366
- const exit = state.enter('headingSetext');
367
- const subexit = state.enter('phrasing');
368
- const value = state.containerPhrasing(node, {
369
- ...tracker.current(),
370
- before: '\n',
371
- after: '\n'
372
- });
373
- subexit();
374
- exit();
375
- return value + '\n' + (1 === rank ? '=' : '-').repeat(value.length - (Math.max(value.lastIndexOf('\r'), value.lastIndexOf('\n')) + 1));
376
- }
377
- const sequence = '#'.repeat(rank);
378
- const exit = state.enter('headingAtx');
379
- const subexit = state.enter('phrasing');
380
- tracker.move(sequence + ' ');
381
- let value = state.containerPhrasing(node, {
382
- before: '# ',
383
- after: '\n',
384
- ...tracker.current()
385
- });
386
- if (/^[\t ]/.test(value)) value = encodeCharacterReference(value.charCodeAt(0)) + value.slice(1);
387
- value = value ? sequence + ' ' + value : sequence;
388
- if (state.options.closeAtx) value += ' ' + sequence;
389
- subexit();
390
- exit();
391
- return value;
392
- }
393
- html.peek = htmlPeek;
394
- function html(node) {
395
- return node.value || '';
396
- }
397
- function htmlPeek() {
398
- return '<';
399
- }
400
- image_image.peek = imagePeek;
401
- function image_image(node, _, state, info) {
402
- const quote = checkQuote(state);
403
- const suffix = '"' === quote ? 'Quote' : 'Apostrophe';
404
- const exit = state.enter('image');
405
- let subexit = state.enter('label');
406
- const tracker = state.createTracker(info);
407
- let value = tracker.move('![');
408
- value += tracker.move(state.safe(node.alt, {
409
- before: value,
410
- after: ']',
411
- ...tracker.current()
412
- }));
413
- value += tracker.move('](');
414
- subexit();
415
- if (!node.url && node.title || /[\0- \u007F]/.test(node.url)) {
416
- subexit = state.enter('destinationLiteral');
417
- value += tracker.move('<');
418
- value += tracker.move(state.safe(node.url, {
419
- before: value,
420
- after: '>',
421
- ...tracker.current()
422
- }));
423
- value += tracker.move('>');
424
- } else {
425
- subexit = state.enter('destinationRaw');
426
- value += tracker.move(state.safe(node.url, {
427
- before: value,
428
- after: node.title ? ' ' : ')',
429
- ...tracker.current()
430
- }));
431
- }
432
- subexit();
433
- if (node.title) {
434
- subexit = state.enter(`title${suffix}`);
435
- value += tracker.move(' ' + quote);
436
- value += tracker.move(state.safe(node.title, {
437
- before: value,
438
- after: quote,
439
- ...tracker.current()
440
- }));
441
- value += tracker.move(quote);
442
- subexit();
443
- }
444
- value += tracker.move(')');
445
- exit();
446
- return value;
447
- }
448
- function imagePeek() {
449
- return '!';
450
- }
451
- imageReference.peek = imageReferencePeek;
452
- function imageReference(node, _, state, info) {
453
- const type = node.referenceType;
454
- const exit = state.enter('imageReference');
455
- let subexit = state.enter('label');
456
- const tracker = state.createTracker(info);
457
- let value = tracker.move('![');
458
- const alt = state.safe(node.alt, {
459
- before: value,
460
- after: ']',
461
- ...tracker.current()
462
- });
463
- value += tracker.move(alt + '][');
464
- subexit();
465
- const stack = state.stack;
466
- state.stack = [];
467
- subexit = state.enter('reference');
468
- const reference = state.safe(state.associationId(node), {
469
- before: value,
470
- after: ']',
471
- ...tracker.current()
472
- });
473
- subexit();
474
- state.stack = stack;
475
- exit();
476
- if ('full' !== type && alt && alt === reference) if ('shortcut' === type) value = value.slice(0, -1);
477
- else value += tracker.move(']');
478
- else value += tracker.move(reference + ']');
479
- return value;
480
- }
481
- function imageReferencePeek() {
482
- return '!';
483
- }
484
- inlineCode.peek = inlineCodePeek;
485
- function inlineCode(node, _, state) {
486
- let value = node.value || '';
487
- let sequence = '`';
488
- let index = -1;
489
- while(new RegExp('(^|[^`])' + sequence + '([^`]|$)').test(value))sequence += '`';
490
- if (/[^ \r\n]/.test(value) && (/^[ \r\n]/.test(value) && /[ \r\n]$/.test(value) || /^`|`$/.test(value))) value = ' ' + value + ' ';
491
- while(++index < state.unsafe.length){
492
- const pattern = state.unsafe[index];
493
- const expression = state.compilePattern(pattern);
494
- let match;
495
- if (!pattern.atBreak) continue;
496
- while(match = expression.exec(value)){
497
- let position = match.index;
498
- if (10 === value.charCodeAt(position) && 13 === value.charCodeAt(position - 1)) position--;
499
- value = value.slice(0, position) + ' ' + value.slice(match.index + 1);
500
- }
501
- }
502
- return sequence + value + sequence;
503
- }
504
- function inlineCodePeek() {
505
- return '`';
506
- }
507
- function formatLinkAsAutolink(node, state) {
508
- const raw = lib_toString(node);
509
- return Boolean(!state.options.resourceLink && node.url && !node.title && node.children && 1 === node.children.length && 'text' === node.children[0].type && (raw === node.url || 'mailto:' + raw === node.url) && /^[a-z][a-z+.-]+:/i.test(node.url) && !/[\0- <>\u007F]/.test(node.url));
510
- }
511
- link_link.peek = linkPeek;
512
- function link_link(node, _, state, info) {
513
- const quote = checkQuote(state);
514
- const suffix = '"' === quote ? 'Quote' : 'Apostrophe';
515
- const tracker = state.createTracker(info);
516
- let exit;
517
- let subexit;
518
- if (formatLinkAsAutolink(node, state)) {
519
- const stack = state.stack;
520
- state.stack = [];
521
- exit = state.enter('autolink');
522
- let value = tracker.move('<');
523
- value += tracker.move(state.containerPhrasing(node, {
524
- before: value,
525
- after: '>',
526
- ...tracker.current()
527
- }));
528
- value += tracker.move('>');
529
- exit();
530
- state.stack = stack;
531
- return value;
532
- }
533
- exit = state.enter('link');
534
- subexit = state.enter('label');
535
- let value = tracker.move('[');
536
- value += tracker.move(state.containerPhrasing(node, {
537
- before: value,
538
- after: '](',
539
- ...tracker.current()
540
- }));
541
- value += tracker.move('](');
542
- subexit();
543
- if (!node.url && node.title || /[\0- \u007F]/.test(node.url)) {
544
- subexit = state.enter('destinationLiteral');
545
- value += tracker.move('<');
546
- value += tracker.move(state.safe(node.url, {
547
- before: value,
548
- after: '>',
549
- ...tracker.current()
550
- }));
551
- value += tracker.move('>');
552
- } else {
553
- subexit = state.enter('destinationRaw');
554
- value += tracker.move(state.safe(node.url, {
555
- before: value,
556
- after: node.title ? ' ' : ')',
557
- ...tracker.current()
558
- }));
559
- }
560
- subexit();
561
- if (node.title) {
562
- subexit = state.enter(`title${suffix}`);
563
- value += tracker.move(' ' + quote);
564
- value += tracker.move(state.safe(node.title, {
565
- before: value,
566
- after: quote,
567
- ...tracker.current()
568
- }));
569
- value += tracker.move(quote);
570
- subexit();
571
- }
572
- value += tracker.move(')');
573
- exit();
574
- return value;
575
- }
576
- function linkPeek(node, _, state) {
577
- return formatLinkAsAutolink(node, state) ? '<' : '[';
578
- }
579
- linkReference.peek = linkReferencePeek;
580
- function linkReference(node, _, state, info) {
581
- const type = node.referenceType;
582
- const exit = state.enter('linkReference');
583
- let subexit = state.enter('label');
584
- const tracker = state.createTracker(info);
585
- let value = tracker.move('[');
586
- const text = state.containerPhrasing(node, {
587
- before: value,
588
- after: ']',
589
- ...tracker.current()
590
- });
591
- value += tracker.move(text + '][');
592
- subexit();
593
- const stack = state.stack;
594
- state.stack = [];
595
- subexit = state.enter('reference');
596
- const reference = state.safe(state.associationId(node), {
597
- before: value,
598
- after: ']',
599
- ...tracker.current()
600
- });
601
- subexit();
602
- state.stack = stack;
603
- exit();
604
- if ('full' !== type && text && text === reference) if ('shortcut' === type) value = value.slice(0, -1);
605
- else value += tracker.move(']');
606
- else value += tracker.move(reference + ']');
607
- return value;
608
- }
609
- function linkReferencePeek() {
610
- return '[';
611
- }
612
- function checkBullet(state) {
613
- const marker = state.options.bullet || '*';
614
- if ('*' !== marker && '+' !== marker && '-' !== marker) throw new Error('Cannot serialize items with `' + marker + '` for `options.bullet`, expected `*`, `+`, or `-`');
615
- return marker;
616
- }
617
- function checkBulletOther(state) {
618
- const bullet = checkBullet(state);
619
- const bulletOther = state.options.bulletOther;
620
- if (!bulletOther) return '*' === bullet ? '-' : '*';
621
- if ('*' !== bulletOther && '+' !== bulletOther && '-' !== bulletOther) throw new Error('Cannot serialize items with `' + bulletOther + '` for `options.bulletOther`, expected `*`, `+`, or `-`');
622
- if (bulletOther === bullet) throw new Error('Expected `bullet` (`' + bullet + '`) and `bulletOther` (`' + bulletOther + '`) to be different');
623
- return bulletOther;
624
- }
625
- function checkBulletOrdered(state) {
626
- const marker = state.options.bulletOrdered || '.';
627
- if ('.' !== marker && ')' !== marker) throw new Error('Cannot serialize items with `' + marker + '` for `options.bulletOrdered`, expected `.` or `)`');
628
- return marker;
629
- }
630
- function checkRule(state) {
631
- const marker = state.options.rule || '*';
632
- if ('*' !== marker && '-' !== marker && '_' !== marker) throw new Error('Cannot serialize rules with `' + marker + '` for `options.rule`, expected `*`, `-`, or `_`');
633
- return marker;
634
- }
635
- function list_list(node, parent, state, info) {
636
- const exit = state.enter('list');
637
- const bulletCurrent = state.bulletCurrent;
638
- let bullet = node.ordered ? checkBulletOrdered(state) : checkBullet(state);
639
- const bulletOther = node.ordered ? '.' === bullet ? ')' : '.' : checkBulletOther(state);
640
- let useDifferentMarker = parent && state.bulletLastUsed ? bullet === state.bulletLastUsed : false;
641
- if (!node.ordered) {
642
- const firstListItem = node.children ? node.children[0] : void 0;
643
- if (('*' === bullet || '-' === bullet) && firstListItem && (!firstListItem.children || !firstListItem.children[0]) && 'list' === state.stack[state.stack.length - 1] && 'listItem' === state.stack[state.stack.length - 2] && 'list' === state.stack[state.stack.length - 3] && 'listItem' === state.stack[state.stack.length - 4] && 0 === state.indexStack[state.indexStack.length - 1] && 0 === state.indexStack[state.indexStack.length - 2] && 0 === state.indexStack[state.indexStack.length - 3]) useDifferentMarker = true;
644
- if (checkRule(state) === bullet && firstListItem) {
645
- let index = -1;
646
- while(++index < node.children.length){
647
- const item = node.children[index];
648
- if (item && 'listItem' === item.type && item.children && item.children[0] && 'thematicBreak' === item.children[0].type) {
649
- useDifferentMarker = true;
650
- break;
651
- }
652
- }
653
- }
654
- }
655
- if (useDifferentMarker) bullet = bulletOther;
656
- state.bulletCurrent = bullet;
657
- const value = state.containerFlow(node, info);
658
- state.bulletLastUsed = bullet;
659
- state.bulletCurrent = bulletCurrent;
660
- exit();
661
- return value;
662
- }
663
- function checkListItemIndent(state) {
664
- const style = state.options.listItemIndent || 'one';
665
- if ('tab' !== style && 'one' !== style && 'mixed' !== style) throw new Error('Cannot serialize items with `' + style + '` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`');
666
- return style;
667
- }
668
- function listItem(node, parent, state, info) {
669
- const listItemIndent = checkListItemIndent(state);
670
- let bullet = state.bulletCurrent || checkBullet(state);
671
- if (parent && 'list' === parent.type && parent.ordered) bullet = ('number' == typeof parent.start && parent.start > -1 ? parent.start : 1) + (false === state.options.incrementListMarker ? 0 : parent.children.indexOf(node)) + bullet;
672
- let size = bullet.length + 1;
673
- if ('tab' === listItemIndent || 'mixed' === listItemIndent && (parent && 'list' === parent.type && parent.spread || node.spread)) size = 4 * Math.ceil(size / 4);
674
- const tracker = state.createTracker(info);
675
- tracker.move(bullet + ' '.repeat(size - bullet.length));
676
- tracker.shift(size);
677
- const exit = state.enter('listItem');
678
- const value = state.indentLines(state.containerFlow(node, tracker.current()), map);
679
- exit();
680
- return value;
681
- function map(line, index, blank) {
682
- if (index) return (blank ? '' : ' '.repeat(size)) + line;
683
- return (blank ? bullet : bullet + ' '.repeat(size - bullet.length)) + line;
684
- }
685
- }
686
- function paragraph(node, _, state, info) {
687
- const exit = state.enter('paragraph');
688
- const subexit = state.enter('phrasing');
689
- const value = state.containerPhrasing(node, info);
690
- subexit();
691
- exit();
692
- return value;
693
- }
694
- const convert = function(test) {
695
- if (null == test) return ok;
696
- if ('function' == typeof test) return castFactory(test);
697
- if ('object' == typeof test) return Array.isArray(test) ? anyFactory(test) : propsFactory(test);
698
- if ('string' == typeof test) return typeFactory(test);
699
- throw new Error('Expected function, string, or object as test');
700
- };
701
- function anyFactory(tests) {
702
- const checks = [];
703
- let index = -1;
704
- while(++index < tests.length)checks[index] = convert(tests[index]);
705
- return castFactory(any);
706
- function any(...parameters) {
707
- let index = -1;
708
- while(++index < checks.length)if (checks[index].apply(this, parameters)) return true;
709
- return false;
710
- }
711
- }
712
- function propsFactory(check) {
713
- const checkAsRecord = check;
714
- return castFactory(all);
715
- function all(node) {
716
- const nodeAsRecord = node;
717
- let key;
718
- for(key in check)if (nodeAsRecord[key] !== checkAsRecord[key]) return false;
719
- return true;
720
- }
721
- }
722
- function typeFactory(check) {
723
- return castFactory(type);
724
- function type(node) {
725
- return node && node.type === check;
726
- }
727
- }
728
- function castFactory(testFunction) {
729
- return check;
730
- function check(value, index, parent) {
731
- return Boolean(looksLikeANode(value) && testFunction.call(this, value, 'number' == typeof index ? index : void 0, parent || void 0));
732
- }
733
- }
734
- function ok() {
735
- return true;
736
- }
737
- function looksLikeANode(value) {
738
- return null !== value && 'object' == typeof value && 'type' in value;
739
- }
740
- const phrasing = convert([
741
- 'break',
742
- 'delete',
743
- 'emphasis',
744
- 'footnote',
745
- 'footnoteReference',
746
- 'image',
747
- 'imageReference',
748
- 'inlineCode',
749
- 'inlineMath',
750
- 'link',
751
- 'linkReference',
752
- 'mdxJsxTextElement',
753
- 'mdxTextExpression',
754
- 'strong',
755
- 'text',
756
- 'textDirective'
757
- ]);
758
- function root(node, _, state, info) {
759
- const hasPhrasing = node.children.some(function(d) {
760
- return phrasing(d);
761
- });
762
- const container = hasPhrasing ? state.containerPhrasing : state.containerFlow;
763
- return container.call(state, node, info);
764
- }
765
- function checkStrong(state) {
766
- const marker = state.options.strong || '*';
767
- if ('*' !== marker && '_' !== marker) throw new Error('Cannot serialize strong with `' + marker + '` for `options.strong`, expected `*`, or `_`');
768
- return marker;
769
- }
770
- strong.peek = strongPeek;
771
- function strong(node, _, state, info) {
772
- const marker = checkStrong(state);
773
- const exit = state.enter('strong');
774
- const tracker = state.createTracker(info);
775
- const before = tracker.move(marker + marker);
776
- let between = tracker.move(state.containerPhrasing(node, {
777
- after: marker,
778
- before,
779
- ...tracker.current()
780
- }));
781
- const betweenHead = between.charCodeAt(0);
782
- const open = encodeInfo(info.before.charCodeAt(info.before.length - 1), betweenHead, marker);
783
- if (open.inside) between = encodeCharacterReference(betweenHead) + between.slice(1);
784
- const betweenTail = between.charCodeAt(between.length - 1);
785
- const close = encodeInfo(info.after.charCodeAt(0), betweenTail, marker);
786
- if (close.inside) between = between.slice(0, -1) + encodeCharacterReference(betweenTail);
787
- const after = tracker.move(marker + marker);
788
- exit();
789
- state.attentionEncodeSurroundingInfo = {
790
- after: close.outside,
791
- before: open.outside
792
- };
793
- return before + between + after;
794
- }
795
- function strongPeek(_, _1, state) {
796
- return state.options.strong || '*';
797
- }
798
- function text_text(node, _, state, info) {
799
- return state.safe(node.value, info);
800
- }
801
- function checkRuleRepetition(state) {
802
- const repetition = state.options.ruleRepetition || 3;
803
- if (repetition < 3) throw new Error('Cannot serialize rules with repetition `' + repetition + '` for `options.ruleRepetition`, expected `3` or more');
804
- return repetition;
805
- }
806
- function thematicBreak(_, _1, state) {
807
- const value = (checkRule(state) + (state.options.ruleSpaces ? ' ' : '')).repeat(checkRuleRepetition(state));
808
- return state.options.ruleSpaces ? value.slice(0, -1) : value;
809
- }
810
- const handle_handle = {
811
- blockquote: blockquote,
812
- break: hardBreak,
813
- code: code_code,
814
- definition: definition,
815
- emphasis: emphasis,
816
- hardBreak: hardBreak,
817
- heading: heading,
818
- html: html,
819
- image: image_image,
820
- imageReference: imageReference,
821
- inlineCode: inlineCode,
822
- link: link_link,
823
- linkReference: linkReference,
824
- list: list_list,
825
- listItem: listItem,
826
- paragraph: paragraph,
827
- root: root,
828
- strong: strong,
829
- text: text_text,
830
- thematicBreak: thematicBreak
831
- };
832
- const join_join = [
833
- joinDefaults
834
- ];
835
- function joinDefaults(left, right, parent, state) {
836
- if ('code' === right.type && formatCodeAsIndented(right, state) && ('list' === left.type || left.type === right.type && formatCodeAsIndented(left, state))) return false;
837
- if ('spread' in parent && 'boolean' == typeof parent.spread) {
838
- if ('paragraph' === left.type && (left.type === right.type || 'definition' === right.type || 'heading' === right.type && formatHeadingAsSetext(right, state))) return;
839
- return parent.spread ? 1 : 0;
840
- }
841
- }
842
- const fullPhrasingSpans = [
843
- 'autolink',
844
- 'destinationLiteral',
845
- 'destinationRaw',
846
- 'reference',
847
- 'titleQuote',
848
- 'titleApostrophe'
849
- ];
850
- const unsafe = [
851
- {
852
- character: '\t',
853
- after: '[\\r\\n]',
854
- inConstruct: 'phrasing'
855
- },
856
- {
857
- character: '\t',
858
- before: '[\\r\\n]',
859
- inConstruct: 'phrasing'
860
- },
861
- {
862
- character: '\t',
863
- inConstruct: [
864
- 'codeFencedLangGraveAccent',
865
- 'codeFencedLangTilde'
866
- ]
867
- },
868
- {
869
- character: '\r',
870
- inConstruct: [
871
- 'codeFencedLangGraveAccent',
872
- 'codeFencedLangTilde',
873
- 'codeFencedMetaGraveAccent',
874
- 'codeFencedMetaTilde',
875
- 'destinationLiteral',
876
- 'headingAtx'
877
- ]
878
- },
879
- {
880
- character: '\n',
881
- inConstruct: [
882
- 'codeFencedLangGraveAccent',
883
- 'codeFencedLangTilde',
884
- 'codeFencedMetaGraveAccent',
885
- 'codeFencedMetaTilde',
886
- 'destinationLiteral',
887
- 'headingAtx'
888
- ]
889
- },
890
- {
891
- character: ' ',
892
- after: '[\\r\\n]',
893
- inConstruct: 'phrasing'
894
- },
895
- {
896
- character: ' ',
897
- before: '[\\r\\n]',
898
- inConstruct: 'phrasing'
899
- },
900
- {
901
- character: ' ',
902
- inConstruct: [
903
- 'codeFencedLangGraveAccent',
904
- 'codeFencedLangTilde'
905
- ]
906
- },
907
- {
908
- character: '!',
909
- after: '\\[',
910
- inConstruct: 'phrasing',
911
- notInConstruct: fullPhrasingSpans
912
- },
913
- {
914
- character: '"',
915
- inConstruct: 'titleQuote'
916
- },
917
- {
918
- atBreak: true,
919
- character: '#'
920
- },
921
- {
922
- character: '#',
923
- inConstruct: 'headingAtx',
924
- after: '(?:[\r\n]|$)'
925
- },
926
- {
927
- character: '&',
928
- after: '[#A-Za-z]',
929
- inConstruct: 'phrasing'
930
- },
931
- {
932
- character: "'",
933
- inConstruct: 'titleApostrophe'
934
- },
935
- {
936
- character: '(',
937
- inConstruct: 'destinationRaw'
938
- },
939
- {
940
- before: '\\]',
941
- character: '(',
942
- inConstruct: 'phrasing',
943
- notInConstruct: fullPhrasingSpans
944
- },
945
- {
946
- atBreak: true,
947
- before: '\\d+',
948
- character: ')'
949
- },
950
- {
951
- character: ')',
952
- inConstruct: 'destinationRaw'
953
- },
954
- {
955
- atBreak: true,
956
- character: '*',
957
- after: '(?:[ \t\r\n*])'
958
- },
959
- {
960
- character: '*',
961
- inConstruct: 'phrasing',
962
- notInConstruct: fullPhrasingSpans
963
- },
964
- {
965
- atBreak: true,
966
- character: '+',
967
- after: '(?:[ \t\r\n])'
968
- },
969
- {
970
- atBreak: true,
971
- character: '-',
972
- after: '(?:[ \t\r\n-])'
973
- },
974
- {
975
- atBreak: true,
976
- before: '\\d+',
977
- character: '.',
978
- after: '(?:[ \t\r\n]|$)'
979
- },
980
- {
981
- atBreak: true,
982
- character: '<',
983
- after: '[!/?A-Za-z]'
984
- },
985
- {
986
- character: '<',
987
- after: '[!/?A-Za-z]',
988
- inConstruct: 'phrasing',
989
- notInConstruct: fullPhrasingSpans
990
- },
991
- {
992
- character: '<',
993
- inConstruct: 'destinationLiteral'
994
- },
995
- {
996
- atBreak: true,
997
- character: '='
998
- },
999
- {
1000
- atBreak: true,
1001
- character: '>'
1002
- },
1003
- {
1004
- character: '>',
1005
- inConstruct: 'destinationLiteral'
1006
- },
1007
- {
1008
- atBreak: true,
1009
- character: '['
1010
- },
1011
- {
1012
- character: '[',
1013
- inConstruct: 'phrasing',
1014
- notInConstruct: fullPhrasingSpans
1015
- },
1016
- {
1017
- character: '[',
1018
- inConstruct: [
1019
- 'label',
1020
- 'reference'
1021
- ]
1022
- },
1023
- {
1024
- character: '\\',
1025
- after: '[\\r\\n]',
1026
- inConstruct: 'phrasing'
1027
- },
1028
- {
1029
- character: ']',
1030
- inConstruct: [
1031
- 'label',
1032
- 'reference'
1033
- ]
1034
- },
1035
- {
1036
- atBreak: true,
1037
- character: '_'
1038
- },
1039
- {
1040
- character: '_',
1041
- inConstruct: 'phrasing',
1042
- notInConstruct: fullPhrasingSpans
1043
- },
1044
- {
1045
- atBreak: true,
1046
- character: '`'
1047
- },
1048
- {
1049
- character: '`',
1050
- inConstruct: [
1051
- 'codeFencedLangGraveAccent',
1052
- 'codeFencedMetaGraveAccent'
1053
- ]
1054
- },
1055
- {
1056
- character: '`',
1057
- inConstruct: 'phrasing',
1058
- notInConstruct: fullPhrasingSpans
1059
- },
1060
- {
1061
- atBreak: true,
1062
- character: '~'
1063
- }
1064
- ];
1065
- const characterEntities = {
1066
- AElig: 'Æ',
1067
- AMP: '&',
1068
- Aacute: 'Á',
1069
- Abreve: 'Ă',
1070
- Acirc: 'Â',
1071
- Acy: 'А',
1072
- Afr: '𝔄',
1073
- Agrave: 'À',
1074
- Alpha: 'Α',
1075
- Amacr: 'Ā',
1076
- And: '⩓',
1077
- Aogon: 'Ą',
1078
- Aopf: '𝔸',
1079
- ApplyFunction: '⁡',
1080
- Aring: 'Å',
1081
- Ascr: '𝒜',
1082
- Assign: '≔',
1083
- Atilde: 'Ã',
1084
- Auml: 'Ä',
1085
- Backslash: '∖',
1086
- Barv: '⫧',
1087
- Barwed: '⌆',
1088
- Bcy: 'Б',
1089
- Because: '∵',
1090
- Bernoullis: 'ℬ',
1091
- Beta: 'Β',
1092
- Bfr: '𝔅',
1093
- Bopf: '𝔹',
1094
- Breve: '˘',
1095
- Bscr: 'ℬ',
1096
- Bumpeq: '≎',
1097
- CHcy: 'Ч',
1098
- COPY: '©',
1099
- Cacute: 'Ć',
1100
- Cap: '⋒',
1101
- CapitalDifferentialD: 'ⅅ',
1102
- Cayleys: 'ℭ',
1103
- Ccaron: 'Č',
1104
- Ccedil: 'Ç',
1105
- Ccirc: 'Ĉ',
1106
- Cconint: '∰',
1107
- Cdot: 'Ċ',
1108
- Cedilla: '¸',
1109
- CenterDot: '·',
1110
- Cfr: 'ℭ',
1111
- Chi: 'Χ',
1112
- CircleDot: '⊙',
1113
- CircleMinus: '⊖',
1114
- CirclePlus: '⊕',
1115
- CircleTimes: '⊗',
1116
- ClockwiseContourIntegral: '∲',
1117
- CloseCurlyDoubleQuote: '”',
1118
- CloseCurlyQuote: '’',
1119
- Colon: '∷',
1120
- Colone: '⩴',
1121
- Congruent: '≡',
1122
- Conint: '∯',
1123
- ContourIntegral: '∮',
1124
- Copf: 'ℂ',
1125
- Coproduct: '∐',
1126
- CounterClockwiseContourIntegral: '∳',
1127
- Cross: '⨯',
1128
- Cscr: '𝒞',
1129
- Cup: '⋓',
1130
- CupCap: '≍',
1131
- DD: 'ⅅ',
1132
- DDotrahd: '⤑',
1133
- DJcy: 'Ђ',
1134
- DScy: 'Ѕ',
1135
- DZcy: 'Џ',
1136
- Dagger: '‡',
1137
- Darr: '↡',
1138
- Dashv: '⫤',
1139
- Dcaron: 'Ď',
1140
- Dcy: 'Д',
1141
- Del: '∇',
1142
- Delta: 'Δ',
1143
- Dfr: '𝔇',
1144
- DiacriticalAcute: '´',
1145
- DiacriticalDot: '˙',
1146
- DiacriticalDoubleAcute: '˝',
1147
- DiacriticalGrave: '`',
1148
- DiacriticalTilde: '˜',
1149
- Diamond: '⋄',
1150
- DifferentialD: 'ⅆ',
1151
- Dopf: '𝔻',
1152
- Dot: '¨',
1153
- DotDot: '⃜',
1154
- DotEqual: '≐',
1155
- DoubleContourIntegral: '∯',
1156
- DoubleDot: '¨',
1157
- DoubleDownArrow: '⇓',
1158
- DoubleLeftArrow: '⇐',
1159
- DoubleLeftRightArrow: '⇔',
1160
- DoubleLeftTee: '⫤',
1161
- DoubleLongLeftArrow: '⟸',
1162
- DoubleLongLeftRightArrow: '⟺',
1163
- DoubleLongRightArrow: '⟹',
1164
- DoubleRightArrow: '⇒',
1165
- DoubleRightTee: '⊨',
1166
- DoubleUpArrow: '⇑',
1167
- DoubleUpDownArrow: '⇕',
1168
- DoubleVerticalBar: '∥',
1169
- DownArrow: '↓',
1170
- DownArrowBar: '⤓',
1171
- DownArrowUpArrow: '⇵',
1172
- DownBreve: '̑',
1173
- DownLeftRightVector: '⥐',
1174
- DownLeftTeeVector: '⥞',
1175
- DownLeftVector: '↽',
1176
- DownLeftVectorBar: '⥖',
1177
- DownRightTeeVector: '⥟',
1178
- DownRightVector: '⇁',
1179
- DownRightVectorBar: '⥗',
1180
- DownTee: '⊤',
1181
- DownTeeArrow: '↧',
1182
- Downarrow: '⇓',
1183
- Dscr: '𝒟',
1184
- Dstrok: 'Đ',
1185
- ENG: 'Ŋ',
1186
- ETH: 'Ð',
1187
- Eacute: 'É',
1188
- Ecaron: 'Ě',
1189
- Ecirc: 'Ê',
1190
- Ecy: 'Э',
1191
- Edot: 'Ė',
1192
- Efr: '𝔈',
1193
- Egrave: 'È',
1194
- Element: '∈',
1195
- Emacr: 'Ē',
1196
- EmptySmallSquare: '◻',
1197
- EmptyVerySmallSquare: '▫',
1198
- Eogon: 'Ę',
1199
- Eopf: '𝔼',
1200
- Epsilon: 'Ε',
1201
- Equal: '⩵',
1202
- EqualTilde: '≂',
1203
- Equilibrium: '⇌',
1204
- Escr: 'ℰ',
1205
- Esim: '⩳',
1206
- Eta: 'Η',
1207
- Euml: 'Ë',
1208
- Exists: '∃',
1209
- ExponentialE: 'ⅇ',
1210
- Fcy: 'Ф',
1211
- Ffr: '𝔉',
1212
- FilledSmallSquare: '◼',
1213
- FilledVerySmallSquare: '▪',
1214
- Fopf: '𝔽',
1215
- ForAll: '∀',
1216
- Fouriertrf: 'ℱ',
1217
- Fscr: 'ℱ',
1218
- GJcy: 'Ѓ',
1219
- GT: '>',
1220
- Gamma: 'Γ',
1221
- Gammad: 'Ϝ',
1222
- Gbreve: 'Ğ',
1223
- Gcedil: 'Ģ',
1224
- Gcirc: 'Ĝ',
1225
- Gcy: 'Г',
1226
- Gdot: 'Ġ',
1227
- Gfr: '𝔊',
1228
- Gg: '⋙',
1229
- Gopf: '𝔾',
1230
- GreaterEqual: '≥',
1231
- GreaterEqualLess: '⋛',
1232
- GreaterFullEqual: '≧',
1233
- GreaterGreater: '⪢',
1234
- GreaterLess: '≷',
1235
- GreaterSlantEqual: '⩾',
1236
- GreaterTilde: '≳',
1237
- Gscr: '𝒢',
1238
- Gt: '≫',
1239
- HARDcy: 'Ъ',
1240
- Hacek: 'ˇ',
1241
- Hat: '^',
1242
- Hcirc: 'Ĥ',
1243
- Hfr: 'ℌ',
1244
- HilbertSpace: 'ℋ',
1245
- Hopf: 'ℍ',
1246
- HorizontalLine: '─',
1247
- Hscr: 'ℋ',
1248
- Hstrok: 'Ħ',
1249
- HumpDownHump: '≎',
1250
- HumpEqual: '≏',
1251
- IEcy: 'Е',
1252
- IJlig: 'IJ',
1253
- IOcy: 'Ё',
1254
- Iacute: 'Í',
1255
- Icirc: 'Î',
1256
- Icy: 'И',
1257
- Idot: 'İ',
1258
- Ifr: 'ℑ',
1259
- Igrave: 'Ì',
1260
- Im: 'ℑ',
1261
- Imacr: 'Ī',
1262
- ImaginaryI: 'ⅈ',
1263
- Implies: '⇒',
1264
- Int: '∬',
1265
- Integral: '∫',
1266
- Intersection: '⋂',
1267
- InvisibleComma: '⁣',
1268
- InvisibleTimes: '⁢',
1269
- Iogon: 'Į',
1270
- Iopf: '𝕀',
1271
- Iota: 'Ι',
1272
- Iscr: 'ℐ',
1273
- Itilde: 'Ĩ',
1274
- Iukcy: 'І',
1275
- Iuml: 'Ï',
1276
- Jcirc: 'Ĵ',
1277
- Jcy: 'Й',
1278
- Jfr: '𝔍',
1279
- Jopf: '𝕁',
1280
- Jscr: '𝒥',
1281
- Jsercy: 'Ј',
1282
- Jukcy: 'Є',
1283
- KHcy: 'Х',
1284
- KJcy: 'Ќ',
1285
- Kappa: 'Κ',
1286
- Kcedil: 'Ķ',
1287
- Kcy: 'К',
1288
- Kfr: '𝔎',
1289
- Kopf: '𝕂',
1290
- Kscr: '𝒦',
1291
- LJcy: 'Љ',
1292
- LT: '<',
1293
- Lacute: 'Ĺ',
1294
- Lambda: 'Λ',
1295
- Lang: '⟪',
1296
- Laplacetrf: 'ℒ',
1297
- Larr: '↞',
1298
- Lcaron: 'Ľ',
1299
- Lcedil: 'Ļ',
1300
- Lcy: 'Л',
1301
- LeftAngleBracket: '⟨',
1302
- LeftArrow: '←',
1303
- LeftArrowBar: '⇤',
1304
- LeftArrowRightArrow: '⇆',
1305
- LeftCeiling: '⌈',
1306
- LeftDoubleBracket: '⟦',
1307
- LeftDownTeeVector: '⥡',
1308
- LeftDownVector: '⇃',
1309
- LeftDownVectorBar: '⥙',
1310
- LeftFloor: '⌊',
1311
- LeftRightArrow: '↔',
1312
- LeftRightVector: '⥎',
1313
- LeftTee: '⊣',
1314
- LeftTeeArrow: '↤',
1315
- LeftTeeVector: '⥚',
1316
- LeftTriangle: '⊲',
1317
- LeftTriangleBar: '⧏',
1318
- LeftTriangleEqual: '⊴',
1319
- LeftUpDownVector: '⥑',
1320
- LeftUpTeeVector: '⥠',
1321
- LeftUpVector: '↿',
1322
- LeftUpVectorBar: '⥘',
1323
- LeftVector: '↼',
1324
- LeftVectorBar: '⥒',
1325
- Leftarrow: '⇐',
1326
- Leftrightarrow: '⇔',
1327
- LessEqualGreater: '⋚',
1328
- LessFullEqual: '≦',
1329
- LessGreater: '≶',
1330
- LessLess: '⪡',
1331
- LessSlantEqual: '⩽',
1332
- LessTilde: '≲',
1333
- Lfr: '𝔏',
1334
- Ll: '⋘',
1335
- Lleftarrow: '⇚',
1336
- Lmidot: 'Ŀ',
1337
- LongLeftArrow: '⟵',
1338
- LongLeftRightArrow: '⟷',
1339
- LongRightArrow: '⟶',
1340
- Longleftarrow: '⟸',
1341
- Longleftrightarrow: '⟺',
1342
- Longrightarrow: '⟹',
1343
- Lopf: '𝕃',
1344
- LowerLeftArrow: '↙',
1345
- LowerRightArrow: '↘',
1346
- Lscr: 'ℒ',
1347
- Lsh: '↰',
1348
- Lstrok: 'Ł',
1349
- Lt: '≪',
1350
- Map: '⤅',
1351
- Mcy: 'М',
1352
- MediumSpace: ' ',
1353
- Mellintrf: 'ℳ',
1354
- Mfr: '𝔐',
1355
- MinusPlus: '∓',
1356
- Mopf: '𝕄',
1357
- Mscr: 'ℳ',
1358
- Mu: 'Μ',
1359
- NJcy: 'Њ',
1360
- Nacute: 'Ń',
1361
- Ncaron: 'Ň',
1362
- Ncedil: 'Ņ',
1363
- Ncy: 'Н',
1364
- NegativeMediumSpace: '​',
1365
- NegativeThickSpace: '​',
1366
- NegativeThinSpace: '​',
1367
- NegativeVeryThinSpace: '​',
1368
- NestedGreaterGreater: '≫',
1369
- NestedLessLess: '≪',
1370
- NewLine: '\n',
1371
- Nfr: '𝔑',
1372
- NoBreak: '⁠',
1373
- NonBreakingSpace: ' ',
1374
- Nopf: 'ℕ',
1375
- Not: '⫬',
1376
- NotCongruent: '≢',
1377
- NotCupCap: '≭',
1378
- NotDoubleVerticalBar: '∦',
1379
- NotElement: '∉',
1380
- NotEqual: '≠',
1381
- NotEqualTilde: '≂̸',
1382
- NotExists: '∄',
1383
- NotGreater: '≯',
1384
- NotGreaterEqual: '≱',
1385
- NotGreaterFullEqual: '≧̸',
1386
- NotGreaterGreater: '≫̸',
1387
- NotGreaterLess: '≹',
1388
- NotGreaterSlantEqual: '⩾̸',
1389
- NotGreaterTilde: '≵',
1390
- NotHumpDownHump: '≎̸',
1391
- NotHumpEqual: '≏̸',
1392
- NotLeftTriangle: '⋪',
1393
- NotLeftTriangleBar: '⧏̸',
1394
- NotLeftTriangleEqual: '⋬',
1395
- NotLess: '≮',
1396
- NotLessEqual: '≰',
1397
- NotLessGreater: '≸',
1398
- NotLessLess: '≪̸',
1399
- NotLessSlantEqual: '⩽̸',
1400
- NotLessTilde: '≴',
1401
- NotNestedGreaterGreater: '⪢̸',
1402
- NotNestedLessLess: '⪡̸',
1403
- NotPrecedes: '⊀',
1404
- NotPrecedesEqual: '⪯̸',
1405
- NotPrecedesSlantEqual: '⋠',
1406
- NotReverseElement: '∌',
1407
- NotRightTriangle: '⋫',
1408
- NotRightTriangleBar: '⧐̸',
1409
- NotRightTriangleEqual: '⋭',
1410
- NotSquareSubset: '⊏̸',
1411
- NotSquareSubsetEqual: '⋢',
1412
- NotSquareSuperset: '⊐̸',
1413
- NotSquareSupersetEqual: '⋣',
1414
- NotSubset: '⊂⃒',
1415
- NotSubsetEqual: '⊈',
1416
- NotSucceeds: '⊁',
1417
- NotSucceedsEqual: '⪰̸',
1418
- NotSucceedsSlantEqual: '⋡',
1419
- NotSucceedsTilde: '≿̸',
1420
- NotSuperset: '⊃⃒',
1421
- NotSupersetEqual: '⊉',
1422
- NotTilde: '≁',
1423
- NotTildeEqual: '≄',
1424
- NotTildeFullEqual: '≇',
1425
- NotTildeTilde: '≉',
1426
- NotVerticalBar: '∤',
1427
- Nscr: '𝒩',
1428
- Ntilde: 'Ñ',
1429
- Nu: 'Ν',
1430
- OElig: 'Œ',
1431
- Oacute: 'Ó',
1432
- Ocirc: 'Ô',
1433
- Ocy: 'О',
1434
- Odblac: 'Ő',
1435
- Ofr: '𝔒',
1436
- Ograve: 'Ò',
1437
- Omacr: 'Ō',
1438
- Omega: 'Ω',
1439
- Omicron: 'Ο',
1440
- Oopf: '𝕆',
1441
- OpenCurlyDoubleQuote: '“',
1442
- OpenCurlyQuote: '‘',
1443
- Or: '⩔',
1444
- Oscr: '𝒪',
1445
- Oslash: 'Ø',
1446
- Otilde: 'Õ',
1447
- Otimes: '⨷',
1448
- Ouml: 'Ö',
1449
- OverBar: '‾',
1450
- OverBrace: '⏞',
1451
- OverBracket: '⎴',
1452
- OverParenthesis: '⏜',
1453
- PartialD: '∂',
1454
- Pcy: 'П',
1455
- Pfr: '𝔓',
1456
- Phi: 'Φ',
1457
- Pi: 'Π',
1458
- PlusMinus: '±',
1459
- Poincareplane: 'ℌ',
1460
- Popf: 'ℙ',
1461
- Pr: '⪻',
1462
- Precedes: '≺',
1463
- PrecedesEqual: '⪯',
1464
- PrecedesSlantEqual: '≼',
1465
- PrecedesTilde: '≾',
1466
- Prime: '″',
1467
- Product: '∏',
1468
- Proportion: '∷',
1469
- Proportional: '∝',
1470
- Pscr: '𝒫',
1471
- Psi: 'Ψ',
1472
- QUOT: '"',
1473
- Qfr: '𝔔',
1474
- Qopf: 'ℚ',
1475
- Qscr: '𝒬',
1476
- RBarr: '⤐',
1477
- REG: '®',
1478
- Racute: 'Ŕ',
1479
- Rang: '⟫',
1480
- Rarr: '↠',
1481
- Rarrtl: '⤖',
1482
- Rcaron: 'Ř',
1483
- Rcedil: 'Ŗ',
1484
- Rcy: 'Р',
1485
- Re: 'ℜ',
1486
- ReverseElement: '∋',
1487
- ReverseEquilibrium: '⇋',
1488
- ReverseUpEquilibrium: '⥯',
1489
- Rfr: 'ℜ',
1490
- Rho: 'Ρ',
1491
- RightAngleBracket: '⟩',
1492
- RightArrow: '→',
1493
- RightArrowBar: '⇥',
1494
- RightArrowLeftArrow: '⇄',
1495
- RightCeiling: '⌉',
1496
- RightDoubleBracket: '⟧',
1497
- RightDownTeeVector: '⥝',
1498
- RightDownVector: '⇂',
1499
- RightDownVectorBar: '⥕',
1500
- RightFloor: '⌋',
1501
- RightTee: '⊢',
1502
- RightTeeArrow: '↦',
1503
- RightTeeVector: '⥛',
1504
- RightTriangle: '⊳',
1505
- RightTriangleBar: '⧐',
1506
- RightTriangleEqual: '⊵',
1507
- RightUpDownVector: '⥏',
1508
- RightUpTeeVector: '⥜',
1509
- RightUpVector: '↾',
1510
- RightUpVectorBar: '⥔',
1511
- RightVector: '⇀',
1512
- RightVectorBar: '⥓',
1513
- Rightarrow: '⇒',
1514
- Ropf: 'ℝ',
1515
- RoundImplies: '⥰',
1516
- Rrightarrow: '⇛',
1517
- Rscr: 'ℛ',
1518
- Rsh: '↱',
1519
- RuleDelayed: '⧴',
1520
- SHCHcy: 'Щ',
1521
- SHcy: 'Ш',
1522
- SOFTcy: 'Ь',
1523
- Sacute: 'Ś',
1524
- Sc: '⪼',
1525
- Scaron: 'Š',
1526
- Scedil: 'Ş',
1527
- Scirc: 'Ŝ',
1528
- Scy: 'С',
1529
- Sfr: '𝔖',
1530
- ShortDownArrow: '↓',
1531
- ShortLeftArrow: '←',
1532
- ShortRightArrow: '→',
1533
- ShortUpArrow: '↑',
1534
- Sigma: 'Σ',
1535
- SmallCircle: '∘',
1536
- Sopf: '𝕊',
1537
- Sqrt: '√',
1538
- Square: '□',
1539
- SquareIntersection: '⊓',
1540
- SquareSubset: '⊏',
1541
- SquareSubsetEqual: '⊑',
1542
- SquareSuperset: '⊐',
1543
- SquareSupersetEqual: '⊒',
1544
- SquareUnion: '⊔',
1545
- Sscr: '𝒮',
1546
- Star: '⋆',
1547
- Sub: '⋐',
1548
- Subset: '⋐',
1549
- SubsetEqual: '⊆',
1550
- Succeeds: '≻',
1551
- SucceedsEqual: '⪰',
1552
- SucceedsSlantEqual: '≽',
1553
- SucceedsTilde: '≿',
1554
- SuchThat: '∋',
1555
- Sum: '∑',
1556
- Sup: '⋑',
1557
- Superset: '⊃',
1558
- SupersetEqual: '⊇',
1559
- Supset: '⋑',
1560
- THORN: 'Þ',
1561
- TRADE: '™',
1562
- TSHcy: 'Ћ',
1563
- TScy: 'Ц',
1564
- Tab: '\t',
1565
- Tau: 'Τ',
1566
- Tcaron: 'Ť',
1567
- Tcedil: 'Ţ',
1568
- Tcy: 'Т',
1569
- Tfr: '𝔗',
1570
- Therefore: '∴',
1571
- Theta: 'Θ',
1572
- ThickSpace: '  ',
1573
- ThinSpace: ' ',
1574
- Tilde: '∼',
1575
- TildeEqual: '≃',
1576
- TildeFullEqual: '≅',
1577
- TildeTilde: '≈',
1578
- Topf: '𝕋',
1579
- TripleDot: '⃛',
1580
- Tscr: '𝒯',
1581
- Tstrok: 'Ŧ',
1582
- Uacute: 'Ú',
1583
- Uarr: '↟',
1584
- Uarrocir: '⥉',
1585
- Ubrcy: 'Ў',
1586
- Ubreve: 'Ŭ',
1587
- Ucirc: 'Û',
1588
- Ucy: 'У',
1589
- Udblac: 'Ű',
1590
- Ufr: '𝔘',
1591
- Ugrave: 'Ù',
1592
- Umacr: 'Ū',
1593
- UnderBar: '_',
1594
- UnderBrace: '⏟',
1595
- UnderBracket: '⎵',
1596
- UnderParenthesis: '⏝',
1597
- Union: '⋃',
1598
- UnionPlus: '⊎',
1599
- Uogon: 'Ų',
1600
- Uopf: '𝕌',
1601
- UpArrow: '↑',
1602
- UpArrowBar: '⤒',
1603
- UpArrowDownArrow: '⇅',
1604
- UpDownArrow: '↕',
1605
- UpEquilibrium: '⥮',
1606
- UpTee: '⊥',
1607
- UpTeeArrow: '↥',
1608
- Uparrow: '⇑',
1609
- Updownarrow: '⇕',
1610
- UpperLeftArrow: '↖',
1611
- UpperRightArrow: '↗',
1612
- Upsi: 'ϒ',
1613
- Upsilon: 'Υ',
1614
- Uring: 'Ů',
1615
- Uscr: '𝒰',
1616
- Utilde: 'Ũ',
1617
- Uuml: 'Ü',
1618
- VDash: '⊫',
1619
- Vbar: '⫫',
1620
- Vcy: 'В',
1621
- Vdash: '⊩',
1622
- Vdashl: '⫦',
1623
- Vee: '⋁',
1624
- Verbar: '‖',
1625
- Vert: '‖',
1626
- VerticalBar: '∣',
1627
- VerticalLine: '|',
1628
- VerticalSeparator: '❘',
1629
- VerticalTilde: '≀',
1630
- VeryThinSpace: ' ',
1631
- Vfr: '𝔙',
1632
- Vopf: '𝕍',
1633
- Vscr: '𝒱',
1634
- Vvdash: '⊪',
1635
- Wcirc: 'Ŵ',
1636
- Wedge: '⋀',
1637
- Wfr: '𝔚',
1638
- Wopf: '𝕎',
1639
- Wscr: '𝒲',
1640
- Xfr: '𝔛',
1641
- Xi: 'Ξ',
1642
- Xopf: '𝕏',
1643
- Xscr: '𝒳',
1644
- YAcy: 'Я',
1645
- YIcy: 'Ї',
1646
- YUcy: 'Ю',
1647
- Yacute: 'Ý',
1648
- Ycirc: 'Ŷ',
1649
- Ycy: 'Ы',
1650
- Yfr: '𝔜',
1651
- Yopf: '𝕐',
1652
- Yscr: '𝒴',
1653
- Yuml: 'Ÿ',
1654
- ZHcy: 'Ж',
1655
- Zacute: 'Ź',
1656
- Zcaron: 'Ž',
1657
- Zcy: 'З',
1658
- Zdot: 'Ż',
1659
- ZeroWidthSpace: '​',
1660
- Zeta: 'Ζ',
1661
- Zfr: 'ℨ',
1662
- Zopf: 'ℤ',
1663
- Zscr: '𝒵',
1664
- aacute: 'á',
1665
- abreve: 'ă',
1666
- ac: '∾',
1667
- acE: '∾̳',
1668
- acd: '∿',
1669
- acirc: 'â',
1670
- acute: '´',
1671
- acy: 'а',
1672
- aelig: 'æ',
1673
- af: '⁡',
1674
- afr: '𝔞',
1675
- agrave: 'à',
1676
- alefsym: 'ℵ',
1677
- aleph: 'ℵ',
1678
- alpha: 'α',
1679
- amacr: 'ā',
1680
- amalg: '⨿',
1681
- amp: '&',
1682
- and: '∧',
1683
- andand: '⩕',
1684
- andd: '⩜',
1685
- andslope: '⩘',
1686
- andv: '⩚',
1687
- ang: '∠',
1688
- ange: '⦤',
1689
- angle: '∠',
1690
- angmsd: '∡',
1691
- angmsdaa: '⦨',
1692
- angmsdab: '⦩',
1693
- angmsdac: '⦪',
1694
- angmsdad: '⦫',
1695
- angmsdae: '⦬',
1696
- angmsdaf: '⦭',
1697
- angmsdag: '⦮',
1698
- angmsdah: '⦯',
1699
- angrt: '∟',
1700
- angrtvb: '⊾',
1701
- angrtvbd: '⦝',
1702
- angsph: '∢',
1703
- angst: 'Å',
1704
- angzarr: '⍼',
1705
- aogon: 'ą',
1706
- aopf: '𝕒',
1707
- ap: '≈',
1708
- apE: '⩰',
1709
- apacir: '⩯',
1710
- ape: '≊',
1711
- apid: '≋',
1712
- apos: "'",
1713
- approx: '≈',
1714
- approxeq: '≊',
1715
- aring: 'å',
1716
- ascr: '𝒶',
1717
- ast: '*',
1718
- asymp: '≈',
1719
- asympeq: '≍',
1720
- atilde: 'ã',
1721
- auml: 'ä',
1722
- awconint: '∳',
1723
- awint: '⨑',
1724
- bNot: '⫭',
1725
- backcong: '≌',
1726
- backepsilon: '϶',
1727
- backprime: '‵',
1728
- backsim: '∽',
1729
- backsimeq: '⋍',
1730
- barvee: '⊽',
1731
- barwed: '⌅',
1732
- barwedge: '⌅',
1733
- bbrk: '⎵',
1734
- bbrktbrk: '⎶',
1735
- bcong: '≌',
1736
- bcy: 'б',
1737
- bdquo: '„',
1738
- becaus: '∵',
1739
- because: '∵',
1740
- bemptyv: '⦰',
1741
- bepsi: '϶',
1742
- bernou: 'ℬ',
1743
- beta: 'β',
1744
- beth: 'ℶ',
1745
- between: '≬',
1746
- bfr: '𝔟',
1747
- bigcap: '⋂',
1748
- bigcirc: '◯',
1749
- bigcup: '⋃',
1750
- bigodot: '⨀',
1751
- bigoplus: '⨁',
1752
- bigotimes: '⨂',
1753
- bigsqcup: '⨆',
1754
- bigstar: '★',
1755
- bigtriangledown: '▽',
1756
- bigtriangleup: '△',
1757
- biguplus: '⨄',
1758
- bigvee: '⋁',
1759
- bigwedge: '⋀',
1760
- bkarow: '⤍',
1761
- blacklozenge: '⧫',
1762
- blacksquare: '▪',
1763
- blacktriangle: '▴',
1764
- blacktriangledown: '▾',
1765
- blacktriangleleft: '◂',
1766
- blacktriangleright: '▸',
1767
- blank: '␣',
1768
- blk12: '▒',
1769
- blk14: '░',
1770
- blk34: '▓',
1771
- block: '█',
1772
- bne: '=⃥',
1773
- bnequiv: '≡⃥',
1774
- bnot: '⌐',
1775
- bopf: '𝕓',
1776
- bot: '⊥',
1777
- bottom: '⊥',
1778
- bowtie: '⋈',
1779
- boxDL: '╗',
1780
- boxDR: '╔',
1781
- boxDl: '╖',
1782
- boxDr: '╓',
1783
- boxH: '═',
1784
- boxHD: '╦',
1785
- boxHU: '╩',
1786
- boxHd: '╤',
1787
- boxHu: '╧',
1788
- boxUL: '╝',
1789
- boxUR: '╚',
1790
- boxUl: '╜',
1791
- boxUr: '╙',
1792
- boxV: '║',
1793
- boxVH: '╬',
1794
- boxVL: '╣',
1795
- boxVR: '╠',
1796
- boxVh: '╫',
1797
- boxVl: '╢',
1798
- boxVr: '╟',
1799
- boxbox: '⧉',
1800
- boxdL: '╕',
1801
- boxdR: '╒',
1802
- boxdl: '┐',
1803
- boxdr: '┌',
1804
- boxh: '─',
1805
- boxhD: '╥',
1806
- boxhU: '╨',
1807
- boxhd: '┬',
1808
- boxhu: '┴',
1809
- boxminus: '⊟',
1810
- boxplus: '⊞',
1811
- boxtimes: '⊠',
1812
- boxuL: '╛',
1813
- boxuR: '╘',
1814
- boxul: '┘',
1815
- boxur: '└',
1816
- boxv: '│',
1817
- boxvH: '╪',
1818
- boxvL: '╡',
1819
- boxvR: '╞',
1820
- boxvh: '┼',
1821
- boxvl: '┤',
1822
- boxvr: '├',
1823
- bprime: '‵',
1824
- breve: '˘',
1825
- brvbar: '¦',
1826
- bscr: '𝒷',
1827
- bsemi: '⁏',
1828
- bsim: '∽',
1829
- bsime: '⋍',
1830
- bsol: '\\',
1831
- bsolb: '⧅',
1832
- bsolhsub: '⟈',
1833
- bull: '•',
1834
- bullet: '•',
1835
- bump: '≎',
1836
- bumpE: '⪮',
1837
- bumpe: '≏',
1838
- bumpeq: '≏',
1839
- cacute: 'ć',
1840
- cap: '∩',
1841
- capand: '⩄',
1842
- capbrcup: '⩉',
1843
- capcap: '⩋',
1844
- capcup: '⩇',
1845
- capdot: '⩀',
1846
- caps: '∩︀',
1847
- caret: '⁁',
1848
- caron: 'ˇ',
1849
- ccaps: '⩍',
1850
- ccaron: 'č',
1851
- ccedil: 'ç',
1852
- ccirc: 'ĉ',
1853
- ccups: '⩌',
1854
- ccupssm: '⩐',
1855
- cdot: 'ċ',
1856
- cedil: '¸',
1857
- cemptyv: '⦲',
1858
- cent: '¢',
1859
- centerdot: '·',
1860
- cfr: '𝔠',
1861
- chcy: 'ч',
1862
- check: '✓',
1863
- checkmark: '✓',
1864
- chi: 'χ',
1865
- cir: '○',
1866
- cirE: '⧃',
1867
- circ: 'ˆ',
1868
- circeq: '≗',
1869
- circlearrowleft: '↺',
1870
- circlearrowright: '↻',
1871
- circledR: '®',
1872
- circledS: 'Ⓢ',
1873
- circledast: '⊛',
1874
- circledcirc: '⊚',
1875
- circleddash: '⊝',
1876
- cire: '≗',
1877
- cirfnint: '⨐',
1878
- cirmid: '⫯',
1879
- cirscir: '⧂',
1880
- clubs: '♣',
1881
- clubsuit: '♣',
1882
- colon: ':',
1883
- colone: '≔',
1884
- coloneq: '≔',
1885
- comma: ',',
1886
- commat: '@',
1887
- comp: '∁',
1888
- compfn: '∘',
1889
- complement: '∁',
1890
- complexes: 'ℂ',
1891
- cong: '≅',
1892
- congdot: '⩭',
1893
- conint: '∮',
1894
- copf: '𝕔',
1895
- coprod: '∐',
1896
- copy: '©',
1897
- copysr: '℗',
1898
- crarr: '↵',
1899
- cross: '✗',
1900
- cscr: '𝒸',
1901
- csub: '⫏',
1902
- csube: '⫑',
1903
- csup: '⫐',
1904
- csupe: '⫒',
1905
- ctdot: '⋯',
1906
- cudarrl: '⤸',
1907
- cudarrr: '⤵',
1908
- cuepr: '⋞',
1909
- cuesc: '⋟',
1910
- cularr: '↶',
1911
- cularrp: '⤽',
1912
- cup: '∪',
1913
- cupbrcap: '⩈',
1914
- cupcap: '⩆',
1915
- cupcup: '⩊',
1916
- cupdot: '⊍',
1917
- cupor: '⩅',
1918
- cups: '∪︀',
1919
- curarr: '↷',
1920
- curarrm: '⤼',
1921
- curlyeqprec: '⋞',
1922
- curlyeqsucc: '⋟',
1923
- curlyvee: '⋎',
1924
- curlywedge: '⋏',
1925
- curren: '¤',
1926
- curvearrowleft: '↶',
1927
- curvearrowright: '↷',
1928
- cuvee: '⋎',
1929
- cuwed: '⋏',
1930
- cwconint: '∲',
1931
- cwint: '∱',
1932
- cylcty: '⌭',
1933
- dArr: '⇓',
1934
- dHar: '⥥',
1935
- dagger: '†',
1936
- daleth: 'ℸ',
1937
- darr: '↓',
1938
- dash: '‐',
1939
- dashv: '⊣',
1940
- dbkarow: '⤏',
1941
- dblac: '˝',
1942
- dcaron: 'ď',
1943
- dcy: 'д',
1944
- dd: 'ⅆ',
1945
- ddagger: '‡',
1946
- ddarr: '⇊',
1947
- ddotseq: '⩷',
1948
- deg: '°',
1949
- delta: 'δ',
1950
- demptyv: '⦱',
1951
- dfisht: '⥿',
1952
- dfr: '𝔡',
1953
- dharl: '⇃',
1954
- dharr: '⇂',
1955
- diam: '⋄',
1956
- diamond: '⋄',
1957
- diamondsuit: '♦',
1958
- diams: '♦',
1959
- die: '¨',
1960
- digamma: 'ϝ',
1961
- disin: '⋲',
1962
- div: '÷',
1963
- divide: '÷',
1964
- divideontimes: '⋇',
1965
- divonx: '⋇',
1966
- djcy: 'ђ',
1967
- dlcorn: '⌞',
1968
- dlcrop: '⌍',
1969
- dollar: '$',
1970
- dopf: '𝕕',
1971
- dot: '˙',
1972
- doteq: '≐',
1973
- doteqdot: '≑',
1974
- dotminus: '∸',
1975
- dotplus: '∔',
1976
- dotsquare: '⊡',
1977
- doublebarwedge: '⌆',
1978
- downarrow: '↓',
1979
- downdownarrows: '⇊',
1980
- downharpoonleft: '⇃',
1981
- downharpoonright: '⇂',
1982
- drbkarow: '⤐',
1983
- drcorn: '⌟',
1984
- drcrop: '⌌',
1985
- dscr: '𝒹',
1986
- dscy: 'ѕ',
1987
- dsol: '⧶',
1988
- dstrok: 'đ',
1989
- dtdot: '⋱',
1990
- dtri: '▿',
1991
- dtrif: '▾',
1992
- duarr: '⇵',
1993
- duhar: '⥯',
1994
- dwangle: '⦦',
1995
- dzcy: 'џ',
1996
- dzigrarr: '⟿',
1997
- eDDot: '⩷',
1998
- eDot: '≑',
1999
- eacute: 'é',
2000
- easter: '⩮',
2001
- ecaron: 'ě',
2002
- ecir: '≖',
2003
- ecirc: 'ê',
2004
- ecolon: '≕',
2005
- ecy: 'э',
2006
- edot: 'ė',
2007
- ee: 'ⅇ',
2008
- efDot: '≒',
2009
- efr: '𝔢',
2010
- eg: '⪚',
2011
- egrave: 'è',
2012
- egs: '⪖',
2013
- egsdot: '⪘',
2014
- el: '⪙',
2015
- elinters: '⏧',
2016
- ell: 'ℓ',
2017
- els: '⪕',
2018
- elsdot: '⪗',
2019
- emacr: 'ē',
2020
- empty: '∅',
2021
- emptyset: '∅',
2022
- emptyv: '∅',
2023
- emsp13: ' ',
2024
- emsp14: ' ',
2025
- emsp: ' ',
2026
- eng: 'ŋ',
2027
- ensp: ' ',
2028
- eogon: 'ę',
2029
- eopf: '𝕖',
2030
- epar: '⋕',
2031
- eparsl: '⧣',
2032
- eplus: '⩱',
2033
- epsi: 'ε',
2034
- epsilon: 'ε',
2035
- epsiv: 'ϵ',
2036
- eqcirc: '≖',
2037
- eqcolon: '≕',
2038
- eqsim: '≂',
2039
- eqslantgtr: '⪖',
2040
- eqslantless: '⪕',
2041
- equals: '=',
2042
- equest: '≟',
2043
- equiv: '≡',
2044
- equivDD: '⩸',
2045
- eqvparsl: '⧥',
2046
- erDot: '≓',
2047
- erarr: '⥱',
2048
- escr: 'ℯ',
2049
- esdot: '≐',
2050
- esim: '≂',
2051
- eta: 'η',
2052
- eth: 'ð',
2053
- euml: 'ë',
2054
- euro: '€',
2055
- excl: '!',
2056
- exist: '∃',
2057
- expectation: 'ℰ',
2058
- exponentiale: 'ⅇ',
2059
- fallingdotseq: '≒',
2060
- fcy: 'ф',
2061
- female: '♀',
2062
- ffilig: 'ffi',
2063
- fflig: 'ff',
2064
- ffllig: 'ffl',
2065
- ffr: '𝔣',
2066
- filig: 'fi',
2067
- fjlig: 'fj',
2068
- flat: '♭',
2069
- fllig: 'fl',
2070
- fltns: '▱',
2071
- fnof: 'ƒ',
2072
- fopf: '𝕗',
2073
- forall: '∀',
2074
- fork: '⋔',
2075
- forkv: '⫙',
2076
- fpartint: '⨍',
2077
- frac12: '½',
2078
- frac13: '⅓',
2079
- frac14: '¼',
2080
- frac15: '⅕',
2081
- frac16: '⅙',
2082
- frac18: '⅛',
2083
- frac23: '⅔',
2084
- frac25: '⅖',
2085
- frac34: '¾',
2086
- frac35: '⅗',
2087
- frac38: '⅜',
2088
- frac45: '⅘',
2089
- frac56: '⅚',
2090
- frac58: '⅝',
2091
- frac78: '⅞',
2092
- frasl: '⁄',
2093
- frown: '⌢',
2094
- fscr: '𝒻',
2095
- gE: '≧',
2096
- gEl: '⪌',
2097
- gacute: 'ǵ',
2098
- gamma: 'γ',
2099
- gammad: 'ϝ',
2100
- gap: '⪆',
2101
- gbreve: 'ğ',
2102
- gcirc: 'ĝ',
2103
- gcy: 'г',
2104
- gdot: 'ġ',
2105
- ge: '≥',
2106
- gel: '⋛',
2107
- geq: '≥',
2108
- geqq: '≧',
2109
- geqslant: '⩾',
2110
- ges: '⩾',
2111
- gescc: '⪩',
2112
- gesdot: '⪀',
2113
- gesdoto: '⪂',
2114
- gesdotol: '⪄',
2115
- gesl: '⋛︀',
2116
- gesles: '⪔',
2117
- gfr: '𝔤',
2118
- gg: '≫',
2119
- ggg: '⋙',
2120
- gimel: 'ℷ',
2121
- gjcy: 'ѓ',
2122
- gl: '≷',
2123
- glE: '⪒',
2124
- gla: '⪥',
2125
- glj: '⪤',
2126
- gnE: '≩',
2127
- gnap: '⪊',
2128
- gnapprox: '⪊',
2129
- gne: '⪈',
2130
- gneq: '⪈',
2131
- gneqq: '≩',
2132
- gnsim: '⋧',
2133
- gopf: '𝕘',
2134
- grave: '`',
2135
- gscr: 'ℊ',
2136
- gsim: '≳',
2137
- gsime: '⪎',
2138
- gsiml: '⪐',
2139
- gt: '>',
2140
- gtcc: '⪧',
2141
- gtcir: '⩺',
2142
- gtdot: '⋗',
2143
- gtlPar: '⦕',
2144
- gtquest: '⩼',
2145
- gtrapprox: '⪆',
2146
- gtrarr: '⥸',
2147
- gtrdot: '⋗',
2148
- gtreqless: '⋛',
2149
- gtreqqless: '⪌',
2150
- gtrless: '≷',
2151
- gtrsim: '≳',
2152
- gvertneqq: '≩︀',
2153
- gvnE: '≩︀',
2154
- hArr: '⇔',
2155
- hairsp: ' ',
2156
- half: '½',
2157
- hamilt: 'ℋ',
2158
- hardcy: 'ъ',
2159
- harr: '↔',
2160
- harrcir: '⥈',
2161
- harrw: '↭',
2162
- hbar: 'ℏ',
2163
- hcirc: 'ĥ',
2164
- hearts: '♥',
2165
- heartsuit: '♥',
2166
- hellip: '…',
2167
- hercon: '⊹',
2168
- hfr: '𝔥',
2169
- hksearow: '⤥',
2170
- hkswarow: '⤦',
2171
- hoarr: '⇿',
2172
- homtht: '∻',
2173
- hookleftarrow: '↩',
2174
- hookrightarrow: '↪',
2175
- hopf: '𝕙',
2176
- horbar: '―',
2177
- hscr: '𝒽',
2178
- hslash: 'ℏ',
2179
- hstrok: 'ħ',
2180
- hybull: '⁃',
2181
- hyphen: '‐',
2182
- iacute: 'í',
2183
- ic: '⁣',
2184
- icirc: 'î',
2185
- icy: 'и',
2186
- iecy: 'е',
2187
- iexcl: '¡',
2188
- iff: '⇔',
2189
- ifr: '𝔦',
2190
- igrave: 'ì',
2191
- ii: 'ⅈ',
2192
- iiiint: '⨌',
2193
- iiint: '∭',
2194
- iinfin: '⧜',
2195
- iiota: '℩',
2196
- ijlig: 'ij',
2197
- imacr: 'ī',
2198
- image: 'ℑ',
2199
- imagline: 'ℐ',
2200
- imagpart: 'ℑ',
2201
- imath: 'ı',
2202
- imof: '⊷',
2203
- imped: 'Ƶ',
2204
- in: '∈',
2205
- incare: '℅',
2206
- infin: '∞',
2207
- infintie: '⧝',
2208
- inodot: 'ı',
2209
- int: '∫',
2210
- intcal: '⊺',
2211
- integers: 'ℤ',
2212
- intercal: '⊺',
2213
- intlarhk: '⨗',
2214
- intprod: '⨼',
2215
- iocy: 'ё',
2216
- iogon: 'į',
2217
- iopf: '𝕚',
2218
- iota: 'ι',
2219
- iprod: '⨼',
2220
- iquest: '¿',
2221
- iscr: '𝒾',
2222
- isin: '∈',
2223
- isinE: '⋹',
2224
- isindot: '⋵',
2225
- isins: '⋴',
2226
- isinsv: '⋳',
2227
- isinv: '∈',
2228
- it: '⁢',
2229
- itilde: 'ĩ',
2230
- iukcy: 'і',
2231
- iuml: 'ï',
2232
- jcirc: 'ĵ',
2233
- jcy: 'й',
2234
- jfr: '𝔧',
2235
- jmath: 'ȷ',
2236
- jopf: '𝕛',
2237
- jscr: '𝒿',
2238
- jsercy: 'ј',
2239
- jukcy: 'є',
2240
- kappa: 'κ',
2241
- kappav: 'ϰ',
2242
- kcedil: 'ķ',
2243
- kcy: 'к',
2244
- kfr: '𝔨',
2245
- kgreen: 'ĸ',
2246
- khcy: 'х',
2247
- kjcy: 'ќ',
2248
- kopf: '𝕜',
2249
- kscr: '𝓀',
2250
- lAarr: '⇚',
2251
- lArr: '⇐',
2252
- lAtail: '⤛',
2253
- lBarr: '⤎',
2254
- lE: '≦',
2255
- lEg: '⪋',
2256
- lHar: '⥢',
2257
- lacute: 'ĺ',
2258
- laemptyv: '⦴',
2259
- lagran: 'ℒ',
2260
- lambda: 'λ',
2261
- lang: '⟨',
2262
- langd: '⦑',
2263
- langle: '⟨',
2264
- lap: '⪅',
2265
- laquo: '«',
2266
- larr: '←',
2267
- larrb: '⇤',
2268
- larrbfs: '⤟',
2269
- larrfs: '⤝',
2270
- larrhk: '↩',
2271
- larrlp: '↫',
2272
- larrpl: '⤹',
2273
- larrsim: '⥳',
2274
- larrtl: '↢',
2275
- lat: '⪫',
2276
- latail: '⤙',
2277
- late: '⪭',
2278
- lates: '⪭︀',
2279
- lbarr: '⤌',
2280
- lbbrk: '❲',
2281
- lbrace: '{',
2282
- lbrack: '[',
2283
- lbrke: '⦋',
2284
- lbrksld: '⦏',
2285
- lbrkslu: '⦍',
2286
- lcaron: 'ľ',
2287
- lcedil: 'ļ',
2288
- lceil: '⌈',
2289
- lcub: '{',
2290
- lcy: 'л',
2291
- ldca: '⤶',
2292
- ldquo: '“',
2293
- ldquor: '„',
2294
- ldrdhar: '⥧',
2295
- ldrushar: '⥋',
2296
- ldsh: '↲',
2297
- le: '≤',
2298
- leftarrow: '←',
2299
- leftarrowtail: '↢',
2300
- leftharpoondown: '↽',
2301
- leftharpoonup: '↼',
2302
- leftleftarrows: '⇇',
2303
- leftrightarrow: '↔',
2304
- leftrightarrows: '⇆',
2305
- leftrightharpoons: '⇋',
2306
- leftrightsquigarrow: '↭',
2307
- leftthreetimes: '⋋',
2308
- leg: '⋚',
2309
- leq: '≤',
2310
- leqq: '≦',
2311
- leqslant: '⩽',
2312
- les: '⩽',
2313
- lescc: '⪨',
2314
- lesdot: '⩿',
2315
- lesdoto: '⪁',
2316
- lesdotor: '⪃',
2317
- lesg: '⋚︀',
2318
- lesges: '⪓',
2319
- lessapprox: '⪅',
2320
- lessdot: '⋖',
2321
- lesseqgtr: '⋚',
2322
- lesseqqgtr: '⪋',
2323
- lessgtr: '≶',
2324
- lesssim: '≲',
2325
- lfisht: '⥼',
2326
- lfloor: '⌊',
2327
- lfr: '𝔩',
2328
- lg: '≶',
2329
- lgE: '⪑',
2330
- lhard: '↽',
2331
- lharu: '↼',
2332
- lharul: '⥪',
2333
- lhblk: '▄',
2334
- ljcy: 'љ',
2335
- ll: '≪',
2336
- llarr: '⇇',
2337
- llcorner: '⌞',
2338
- llhard: '⥫',
2339
- lltri: '◺',
2340
- lmidot: 'ŀ',
2341
- lmoust: '⎰',
2342
- lmoustache: '⎰',
2343
- lnE: '≨',
2344
- lnap: '⪉',
2345
- lnapprox: '⪉',
2346
- lne: '⪇',
2347
- lneq: '⪇',
2348
- lneqq: '≨',
2349
- lnsim: '⋦',
2350
- loang: '⟬',
2351
- loarr: '⇽',
2352
- lobrk: '⟦',
2353
- longleftarrow: '⟵',
2354
- longleftrightarrow: '⟷',
2355
- longmapsto: '⟼',
2356
- longrightarrow: '⟶',
2357
- looparrowleft: '↫',
2358
- looparrowright: '↬',
2359
- lopar: '⦅',
2360
- lopf: '𝕝',
2361
- loplus: '⨭',
2362
- lotimes: '⨴',
2363
- lowast: '∗',
2364
- lowbar: '_',
2365
- loz: '◊',
2366
- lozenge: '◊',
2367
- lozf: '⧫',
2368
- lpar: '(',
2369
- lparlt: '⦓',
2370
- lrarr: '⇆',
2371
- lrcorner: '⌟',
2372
- lrhar: '⇋',
2373
- lrhard: '⥭',
2374
- lrm: '‎',
2375
- lrtri: '⊿',
2376
- lsaquo: '‹',
2377
- lscr: '𝓁',
2378
- lsh: '↰',
2379
- lsim: '≲',
2380
- lsime: '⪍',
2381
- lsimg: '⪏',
2382
- lsqb: '[',
2383
- lsquo: '‘',
2384
- lsquor: '‚',
2385
- lstrok: 'ł',
2386
- lt: '<',
2387
- ltcc: '⪦',
2388
- ltcir: '⩹',
2389
- ltdot: '⋖',
2390
- lthree: '⋋',
2391
- ltimes: '⋉',
2392
- ltlarr: '⥶',
2393
- ltquest: '⩻',
2394
- ltrPar: '⦖',
2395
- ltri: '◃',
2396
- ltrie: '⊴',
2397
- ltrif: '◂',
2398
- lurdshar: '⥊',
2399
- luruhar: '⥦',
2400
- lvertneqq: '≨︀',
2401
- lvnE: '≨︀',
2402
- mDDot: '∺',
2403
- macr: '¯',
2404
- male: '♂',
2405
- malt: '✠',
2406
- maltese: '✠',
2407
- map: '↦',
2408
- mapsto: '↦',
2409
- mapstodown: '↧',
2410
- mapstoleft: '↤',
2411
- mapstoup: '↥',
2412
- marker: '▮',
2413
- mcomma: '⨩',
2414
- mcy: 'м',
2415
- mdash: '—',
2416
- measuredangle: '∡',
2417
- mfr: '𝔪',
2418
- mho: '℧',
2419
- micro: 'µ',
2420
- mid: '∣',
2421
- midast: '*',
2422
- midcir: '⫰',
2423
- middot: '·',
2424
- minus: '−',
2425
- minusb: '⊟',
2426
- minusd: '∸',
2427
- minusdu: '⨪',
2428
- mlcp: '⫛',
2429
- mldr: '…',
2430
- mnplus: '∓',
2431
- models: '⊧',
2432
- mopf: '𝕞',
2433
- mp: '∓',
2434
- mscr: '𝓂',
2435
- mstpos: '∾',
2436
- mu: 'μ',
2437
- multimap: '⊸',
2438
- mumap: '⊸',
2439
- nGg: '⋙̸',
2440
- nGt: '≫⃒',
2441
- nGtv: '≫̸',
2442
- nLeftarrow: '⇍',
2443
- nLeftrightarrow: '⇎',
2444
- nLl: '⋘̸',
2445
- nLt: '≪⃒',
2446
- nLtv: '≪̸',
2447
- nRightarrow: '⇏',
2448
- nVDash: '⊯',
2449
- nVdash: '⊮',
2450
- nabla: '∇',
2451
- nacute: 'ń',
2452
- nang: '∠⃒',
2453
- nap: '≉',
2454
- napE: '⩰̸',
2455
- napid: '≋̸',
2456
- napos: 'ʼn',
2457
- napprox: '≉',
2458
- natur: '♮',
2459
- natural: '♮',
2460
- naturals: 'ℕ',
2461
- nbsp: ' ',
2462
- nbump: '≎̸',
2463
- nbumpe: '≏̸',
2464
- ncap: '⩃',
2465
- ncaron: 'ň',
2466
- ncedil: 'ņ',
2467
- ncong: '≇',
2468
- ncongdot: '⩭̸',
2469
- ncup: '⩂',
2470
- ncy: 'н',
2471
- ndash: '–',
2472
- ne: '≠',
2473
- neArr: '⇗',
2474
- nearhk: '⤤',
2475
- nearr: '↗',
2476
- nearrow: '↗',
2477
- nedot: '≐̸',
2478
- nequiv: '≢',
2479
- nesear: '⤨',
2480
- nesim: '≂̸',
2481
- nexist: '∄',
2482
- nexists: '∄',
2483
- nfr: '𝔫',
2484
- ngE: '≧̸',
2485
- nge: '≱',
2486
- ngeq: '≱',
2487
- ngeqq: '≧̸',
2488
- ngeqslant: '⩾̸',
2489
- nges: '⩾̸',
2490
- ngsim: '≵',
2491
- ngt: '≯',
2492
- ngtr: '≯',
2493
- nhArr: '⇎',
2494
- nharr: '↮',
2495
- nhpar: '⫲',
2496
- ni: '∋',
2497
- nis: '⋼',
2498
- nisd: '⋺',
2499
- niv: '∋',
2500
- njcy: 'њ',
2501
- nlArr: '⇍',
2502
- nlE: '≦̸',
2503
- nlarr: '↚',
2504
- nldr: '‥',
2505
- nle: '≰',
2506
- nleftarrow: '↚',
2507
- nleftrightarrow: '↮',
2508
- nleq: '≰',
2509
- nleqq: '≦̸',
2510
- nleqslant: '⩽̸',
2511
- nles: '⩽̸',
2512
- nless: '≮',
2513
- nlsim: '≴',
2514
- nlt: '≮',
2515
- nltri: '⋪',
2516
- nltrie: '⋬',
2517
- nmid: '∤',
2518
- nopf: '𝕟',
2519
- not: '¬',
2520
- notin: '∉',
2521
- notinE: '⋹̸',
2522
- notindot: '⋵̸',
2523
- notinva: '∉',
2524
- notinvb: '⋷',
2525
- notinvc: '⋶',
2526
- notni: '∌',
2527
- notniva: '∌',
2528
- notnivb: '⋾',
2529
- notnivc: '⋽',
2530
- npar: '∦',
2531
- nparallel: '∦',
2532
- nparsl: '⫽⃥',
2533
- npart: '∂̸',
2534
- npolint: '⨔',
2535
- npr: '⊀',
2536
- nprcue: '⋠',
2537
- npre: '⪯̸',
2538
- nprec: '⊀',
2539
- npreceq: '⪯̸',
2540
- nrArr: '⇏',
2541
- nrarr: '↛',
2542
- nrarrc: '⤳̸',
2543
- nrarrw: '↝̸',
2544
- nrightarrow: '↛',
2545
- nrtri: '⋫',
2546
- nrtrie: '⋭',
2547
- nsc: '⊁',
2548
- nsccue: '⋡',
2549
- nsce: '⪰̸',
2550
- nscr: '𝓃',
2551
- nshortmid: '∤',
2552
- nshortparallel: '∦',
2553
- nsim: '≁',
2554
- nsime: '≄',
2555
- nsimeq: '≄',
2556
- nsmid: '∤',
2557
- nspar: '∦',
2558
- nsqsube: '⋢',
2559
- nsqsupe: '⋣',
2560
- nsub: '⊄',
2561
- nsubE: '⫅̸',
2562
- nsube: '⊈',
2563
- nsubset: '⊂⃒',
2564
- nsubseteq: '⊈',
2565
- nsubseteqq: '⫅̸',
2566
- nsucc: '⊁',
2567
- nsucceq: '⪰̸',
2568
- nsup: '⊅',
2569
- nsupE: '⫆̸',
2570
- nsupe: '⊉',
2571
- nsupset: '⊃⃒',
2572
- nsupseteq: '⊉',
2573
- nsupseteqq: '⫆̸',
2574
- ntgl: '≹',
2575
- ntilde: 'ñ',
2576
- ntlg: '≸',
2577
- ntriangleleft: '⋪',
2578
- ntrianglelefteq: '⋬',
2579
- ntriangleright: '⋫',
2580
- ntrianglerighteq: '⋭',
2581
- nu: 'ν',
2582
- num: '#',
2583
- numero: '№',
2584
- numsp: ' ',
2585
- nvDash: '⊭',
2586
- nvHarr: '⤄',
2587
- nvap: '≍⃒',
2588
- nvdash: '⊬',
2589
- nvge: '≥⃒',
2590
- nvgt: '>⃒',
2591
- nvinfin: '⧞',
2592
- nvlArr: '⤂',
2593
- nvle: '≤⃒',
2594
- nvlt: '<⃒',
2595
- nvltrie: '⊴⃒',
2596
- nvrArr: '⤃',
2597
- nvrtrie: '⊵⃒',
2598
- nvsim: '∼⃒',
2599
- nwArr: '⇖',
2600
- nwarhk: '⤣',
2601
- nwarr: '↖',
2602
- nwarrow: '↖',
2603
- nwnear: '⤧',
2604
- oS: 'Ⓢ',
2605
- oacute: 'ó',
2606
- oast: '⊛',
2607
- ocir: '⊚',
2608
- ocirc: 'ô',
2609
- ocy: 'о',
2610
- odash: '⊝',
2611
- odblac: 'ő',
2612
- odiv: '⨸',
2613
- odot: '⊙',
2614
- odsold: '⦼',
2615
- oelig: 'œ',
2616
- ofcir: '⦿',
2617
- ofr: '𝔬',
2618
- ogon: '˛',
2619
- ograve: 'ò',
2620
- ogt: '⧁',
2621
- ohbar: '⦵',
2622
- ohm: 'Ω',
2623
- oint: '∮',
2624
- olarr: '↺',
2625
- olcir: '⦾',
2626
- olcross: '⦻',
2627
- oline: '‾',
2628
- olt: '⧀',
2629
- omacr: 'ō',
2630
- omega: 'ω',
2631
- omicron: 'ο',
2632
- omid: '⦶',
2633
- ominus: '⊖',
2634
- oopf: '𝕠',
2635
- opar: '⦷',
2636
- operp: '⦹',
2637
- oplus: '⊕',
2638
- or: '∨',
2639
- orarr: '↻',
2640
- ord: '⩝',
2641
- order: 'ℴ',
2642
- orderof: 'ℴ',
2643
- ordf: 'ª',
2644
- ordm: 'º',
2645
- origof: '⊶',
2646
- oror: '⩖',
2647
- orslope: '⩗',
2648
- orv: '⩛',
2649
- oscr: 'ℴ',
2650
- oslash: 'ø',
2651
- osol: '⊘',
2652
- otilde: 'õ',
2653
- otimes: '⊗',
2654
- otimesas: '⨶',
2655
- ouml: 'ö',
2656
- ovbar: '⌽',
2657
- par: '∥',
2658
- para: '¶',
2659
- parallel: '∥',
2660
- parsim: '⫳',
2661
- parsl: '⫽',
2662
- part: '∂',
2663
- pcy: 'п',
2664
- percnt: '%',
2665
- period: '.',
2666
- permil: '‰',
2667
- perp: '⊥',
2668
- pertenk: '‱',
2669
- pfr: '𝔭',
2670
- phi: 'φ',
2671
- phiv: 'ϕ',
2672
- phmmat: 'ℳ',
2673
- phone: '☎',
2674
- pi: 'π',
2675
- pitchfork: '⋔',
2676
- piv: 'ϖ',
2677
- planck: 'ℏ',
2678
- planckh: 'ℎ',
2679
- plankv: 'ℏ',
2680
- plus: '+',
2681
- plusacir: '⨣',
2682
- plusb: '⊞',
2683
- pluscir: '⨢',
2684
- plusdo: '∔',
2685
- plusdu: '⨥',
2686
- pluse: '⩲',
2687
- plusmn: '±',
2688
- plussim: '⨦',
2689
- plustwo: '⨧',
2690
- pm: '±',
2691
- pointint: '⨕',
2692
- popf: '𝕡',
2693
- pound: '£',
2694
- pr: '≺',
2695
- prE: '⪳',
2696
- prap: '⪷',
2697
- prcue: '≼',
2698
- pre: '⪯',
2699
- prec: '≺',
2700
- precapprox: '⪷',
2701
- preccurlyeq: '≼',
2702
- preceq: '⪯',
2703
- precnapprox: '⪹',
2704
- precneqq: '⪵',
2705
- precnsim: '⋨',
2706
- precsim: '≾',
2707
- prime: '′',
2708
- primes: 'ℙ',
2709
- prnE: '⪵',
2710
- prnap: '⪹',
2711
- prnsim: '⋨',
2712
- prod: '∏',
2713
- profalar: '⌮',
2714
- profline: '⌒',
2715
- profsurf: '⌓',
2716
- prop: '∝',
2717
- propto: '∝',
2718
- prsim: '≾',
2719
- prurel: '⊰',
2720
- pscr: '𝓅',
2721
- psi: 'ψ',
2722
- puncsp: ' ',
2723
- qfr: '𝔮',
2724
- qint: '⨌',
2725
- qopf: '𝕢',
2726
- qprime: '⁗',
2727
- qscr: '𝓆',
2728
- quaternions: 'ℍ',
2729
- quatint: '⨖',
2730
- quest: '?',
2731
- questeq: '≟',
2732
- quot: '"',
2733
- rAarr: '⇛',
2734
- rArr: '⇒',
2735
- rAtail: '⤜',
2736
- rBarr: '⤏',
2737
- rHar: '⥤',
2738
- race: '∽̱',
2739
- racute: 'ŕ',
2740
- radic: '√',
2741
- raemptyv: '⦳',
2742
- rang: '⟩',
2743
- rangd: '⦒',
2744
- range: '⦥',
2745
- rangle: '⟩',
2746
- raquo: '»',
2747
- rarr: '→',
2748
- rarrap: '⥵',
2749
- rarrb: '⇥',
2750
- rarrbfs: '⤠',
2751
- rarrc: '⤳',
2752
- rarrfs: '⤞',
2753
- rarrhk: '↪',
2754
- rarrlp: '↬',
2755
- rarrpl: '⥅',
2756
- rarrsim: '⥴',
2757
- rarrtl: '↣',
2758
- rarrw: '↝',
2759
- ratail: '⤚',
2760
- ratio: '∶',
2761
- rationals: 'ℚ',
2762
- rbarr: '⤍',
2763
- rbbrk: '❳',
2764
- rbrace: '}',
2765
- rbrack: ']',
2766
- rbrke: '⦌',
2767
- rbrksld: '⦎',
2768
- rbrkslu: '⦐',
2769
- rcaron: 'ř',
2770
- rcedil: 'ŗ',
2771
- rceil: '⌉',
2772
- rcub: '}',
2773
- rcy: 'р',
2774
- rdca: '⤷',
2775
- rdldhar: '⥩',
2776
- rdquo: '”',
2777
- rdquor: '”',
2778
- rdsh: '↳',
2779
- real: 'ℜ',
2780
- realine: 'ℛ',
2781
- realpart: 'ℜ',
2782
- reals: 'ℝ',
2783
- rect: '▭',
2784
- reg: '®',
2785
- rfisht: '⥽',
2786
- rfloor: '⌋',
2787
- rfr: '𝔯',
2788
- rhard: '⇁',
2789
- rharu: '⇀',
2790
- rharul: '⥬',
2791
- rho: 'ρ',
2792
- rhov: 'ϱ',
2793
- rightarrow: '→',
2794
- rightarrowtail: '↣',
2795
- rightharpoondown: '⇁',
2796
- rightharpoonup: '⇀',
2797
- rightleftarrows: '⇄',
2798
- rightleftharpoons: '⇌',
2799
- rightrightarrows: '⇉',
2800
- rightsquigarrow: '↝',
2801
- rightthreetimes: '⋌',
2802
- ring: '˚',
2803
- risingdotseq: '≓',
2804
- rlarr: '⇄',
2805
- rlhar: '⇌',
2806
- rlm: '‏',
2807
- rmoust: '⎱',
2808
- rmoustache: '⎱',
2809
- rnmid: '⫮',
2810
- roang: '⟭',
2811
- roarr: '⇾',
2812
- robrk: '⟧',
2813
- ropar: '⦆',
2814
- ropf: '𝕣',
2815
- roplus: '⨮',
2816
- rotimes: '⨵',
2817
- rpar: ')',
2818
- rpargt: '⦔',
2819
- rppolint: '⨒',
2820
- rrarr: '⇉',
2821
- rsaquo: '›',
2822
- rscr: '𝓇',
2823
- rsh: '↱',
2824
- rsqb: ']',
2825
- rsquo: '’',
2826
- rsquor: '’',
2827
- rthree: '⋌',
2828
- rtimes: '⋊',
2829
- rtri: '▹',
2830
- rtrie: '⊵',
2831
- rtrif: '▸',
2832
- rtriltri: '⧎',
2833
- ruluhar: '⥨',
2834
- rx: '℞',
2835
- sacute: 'ś',
2836
- sbquo: '‚',
2837
- sc: '≻',
2838
- scE: '⪴',
2839
- scap: '⪸',
2840
- scaron: 'š',
2841
- sccue: '≽',
2842
- sce: '⪰',
2843
- scedil: 'ş',
2844
- scirc: 'ŝ',
2845
- scnE: '⪶',
2846
- scnap: '⪺',
2847
- scnsim: '⋩',
2848
- scpolint: '⨓',
2849
- scsim: '≿',
2850
- scy: 'с',
2851
- sdot: '⋅',
2852
- sdotb: '⊡',
2853
- sdote: '⩦',
2854
- seArr: '⇘',
2855
- searhk: '⤥',
2856
- searr: '↘',
2857
- searrow: '↘',
2858
- sect: '§',
2859
- semi: ';',
2860
- seswar: '⤩',
2861
- setminus: '∖',
2862
- setmn: '∖',
2863
- sext: '✶',
2864
- sfr: '𝔰',
2865
- sfrown: '⌢',
2866
- sharp: '♯',
2867
- shchcy: 'щ',
2868
- shcy: 'ш',
2869
- shortmid: '∣',
2870
- shortparallel: '∥',
2871
- shy: '­',
2872
- sigma: 'σ',
2873
- sigmaf: 'ς',
2874
- sigmav: 'ς',
2875
- sim: '∼',
2876
- simdot: '⩪',
2877
- sime: '≃',
2878
- simeq: '≃',
2879
- simg: '⪞',
2880
- simgE: '⪠',
2881
- siml: '⪝',
2882
- simlE: '⪟',
2883
- simne: '≆',
2884
- simplus: '⨤',
2885
- simrarr: '⥲',
2886
- slarr: '←',
2887
- smallsetminus: '∖',
2888
- smashp: '⨳',
2889
- smeparsl: '⧤',
2890
- smid: '∣',
2891
- smile: '⌣',
2892
- smt: '⪪',
2893
- smte: '⪬',
2894
- smtes: '⪬︀',
2895
- softcy: 'ь',
2896
- sol: '/',
2897
- solb: '⧄',
2898
- solbar: '⌿',
2899
- sopf: '𝕤',
2900
- spades: '♠',
2901
- spadesuit: '♠',
2902
- spar: '∥',
2903
- sqcap: '⊓',
2904
- sqcaps: '⊓︀',
2905
- sqcup: '⊔',
2906
- sqcups: '⊔︀',
2907
- sqsub: '⊏',
2908
- sqsube: '⊑',
2909
- sqsubset: '⊏',
2910
- sqsubseteq: '⊑',
2911
- sqsup: '⊐',
2912
- sqsupe: '⊒',
2913
- sqsupset: '⊐',
2914
- sqsupseteq: '⊒',
2915
- squ: '□',
2916
- square: '□',
2917
- squarf: '▪',
2918
- squf: '▪',
2919
- srarr: '→',
2920
- sscr: '𝓈',
2921
- ssetmn: '∖',
2922
- ssmile: '⌣',
2923
- sstarf: '⋆',
2924
- star: '☆',
2925
- starf: '★',
2926
- straightepsilon: 'ϵ',
2927
- straightphi: 'ϕ',
2928
- strns: '¯',
2929
- sub: '⊂',
2930
- subE: '⫅',
2931
- subdot: '⪽',
2932
- sube: '⊆',
2933
- subedot: '⫃',
2934
- submult: '⫁',
2935
- subnE: '⫋',
2936
- subne: '⊊',
2937
- subplus: '⪿',
2938
- subrarr: '⥹',
2939
- subset: '⊂',
2940
- subseteq: '⊆',
2941
- subseteqq: '⫅',
2942
- subsetneq: '⊊',
2943
- subsetneqq: '⫋',
2944
- subsim: '⫇',
2945
- subsub: '⫕',
2946
- subsup: '⫓',
2947
- succ: '≻',
2948
- succapprox: '⪸',
2949
- succcurlyeq: '≽',
2950
- succeq: '⪰',
2951
- succnapprox: '⪺',
2952
- succneqq: '⪶',
2953
- succnsim: '⋩',
2954
- succsim: '≿',
2955
- sum: '∑',
2956
- sung: '♪',
2957
- sup1: '¹',
2958
- sup2: '²',
2959
- sup3: '³',
2960
- sup: '⊃',
2961
- supE: '⫆',
2962
- supdot: '⪾',
2963
- supdsub: '⫘',
2964
- supe: '⊇',
2965
- supedot: '⫄',
2966
- suphsol: '⟉',
2967
- suphsub: '⫗',
2968
- suplarr: '⥻',
2969
- supmult: '⫂',
2970
- supnE: '⫌',
2971
- supne: '⊋',
2972
- supplus: '⫀',
2973
- supset: '⊃',
2974
- supseteq: '⊇',
2975
- supseteqq: '⫆',
2976
- supsetneq: '⊋',
2977
- supsetneqq: '⫌',
2978
- supsim: '⫈',
2979
- supsub: '⫔',
2980
- supsup: '⫖',
2981
- swArr: '⇙',
2982
- swarhk: '⤦',
2983
- swarr: '↙',
2984
- swarrow: '↙',
2985
- swnwar: '⤪',
2986
- szlig: 'ß',
2987
- target: '⌖',
2988
- tau: 'τ',
2989
- tbrk: '⎴',
2990
- tcaron: 'ť',
2991
- tcedil: 'ţ',
2992
- tcy: 'т',
2993
- tdot: '⃛',
2994
- telrec: '⌕',
2995
- tfr: '𝔱',
2996
- there4: '∴',
2997
- therefore: '∴',
2998
- theta: 'θ',
2999
- thetasym: 'ϑ',
3000
- thetav: 'ϑ',
3001
- thickapprox: '≈',
3002
- thicksim: '∼',
3003
- thinsp: ' ',
3004
- thkap: '≈',
3005
- thksim: '∼',
3006
- thorn: 'þ',
3007
- tilde: '˜',
3008
- times: '×',
3009
- timesb: '⊠',
3010
- timesbar: '⨱',
3011
- timesd: '⨰',
3012
- tint: '∭',
3013
- toea: '⤨',
3014
- top: '⊤',
3015
- topbot: '⌶',
3016
- topcir: '⫱',
3017
- topf: '𝕥',
3018
- topfork: '⫚',
3019
- tosa: '⤩',
3020
- tprime: '‴',
3021
- trade: '™',
3022
- triangle: '▵',
3023
- triangledown: '▿',
3024
- triangleleft: '◃',
3025
- trianglelefteq: '⊴',
3026
- triangleq: '≜',
3027
- triangleright: '▹',
3028
- trianglerighteq: '⊵',
3029
- tridot: '◬',
3030
- trie: '≜',
3031
- triminus: '⨺',
3032
- triplus: '⨹',
3033
- trisb: '⧍',
3034
- tritime: '⨻',
3035
- trpezium: '⏢',
3036
- tscr: '𝓉',
3037
- tscy: 'ц',
3038
- tshcy: 'ћ',
3039
- tstrok: 'ŧ',
3040
- twixt: '≬',
3041
- twoheadleftarrow: '↞',
3042
- twoheadrightarrow: '↠',
3043
- uArr: '⇑',
3044
- uHar: '⥣',
3045
- uacute: 'ú',
3046
- uarr: '↑',
3047
- ubrcy: 'ў',
3048
- ubreve: 'ŭ',
3049
- ucirc: 'û',
3050
- ucy: 'у',
3051
- udarr: '⇅',
3052
- udblac: 'ű',
3053
- udhar: '⥮',
3054
- ufisht: '⥾',
3055
- ufr: '𝔲',
3056
- ugrave: 'ù',
3057
- uharl: '↿',
3058
- uharr: '↾',
3059
- uhblk: '▀',
3060
- ulcorn: '⌜',
3061
- ulcorner: '⌜',
3062
- ulcrop: '⌏',
3063
- ultri: '◸',
3064
- umacr: 'ū',
3065
- uml: '¨',
3066
- uogon: 'ų',
3067
- uopf: '𝕦',
3068
- uparrow: '↑',
3069
- updownarrow: '↕',
3070
- upharpoonleft: '↿',
3071
- upharpoonright: '↾',
3072
- uplus: '⊎',
3073
- upsi: 'υ',
3074
- upsih: 'ϒ',
3075
- upsilon: 'υ',
3076
- upuparrows: '⇈',
3077
- urcorn: '⌝',
3078
- urcorner: '⌝',
3079
- urcrop: '⌎',
3080
- uring: 'ů',
3081
- urtri: '◹',
3082
- uscr: '𝓊',
3083
- utdot: '⋰',
3084
- utilde: 'ũ',
3085
- utri: '▵',
3086
- utrif: '▴',
3087
- uuarr: '⇈',
3088
- uuml: 'ü',
3089
- uwangle: '⦧',
3090
- vArr: '⇕',
3091
- vBar: '⫨',
3092
- vBarv: '⫩',
3093
- vDash: '⊨',
3094
- vangrt: '⦜',
3095
- varepsilon: 'ϵ',
3096
- varkappa: 'ϰ',
3097
- varnothing: '∅',
3098
- varphi: 'ϕ',
3099
- varpi: 'ϖ',
3100
- varpropto: '∝',
3101
- varr: '↕',
3102
- varrho: 'ϱ',
3103
- varsigma: 'ς',
3104
- varsubsetneq: '⊊︀',
3105
- varsubsetneqq: '⫋︀',
3106
- varsupsetneq: '⊋︀',
3107
- varsupsetneqq: '⫌︀',
3108
- vartheta: 'ϑ',
3109
- vartriangleleft: '⊲',
3110
- vartriangleright: '⊳',
3111
- vcy: 'в',
3112
- vdash: '⊢',
3113
- vee: '∨',
3114
- veebar: '⊻',
3115
- veeeq: '≚',
3116
- vellip: '⋮',
3117
- verbar: '|',
3118
- vert: '|',
3119
- vfr: '𝔳',
3120
- vltri: '⊲',
3121
- vnsub: '⊂⃒',
3122
- vnsup: '⊃⃒',
3123
- vopf: '𝕧',
3124
- vprop: '∝',
3125
- vrtri: '⊳',
3126
- vscr: '𝓋',
3127
- vsubnE: '⫋︀',
3128
- vsubne: '⊊︀',
3129
- vsupnE: '⫌︀',
3130
- vsupne: '⊋︀',
3131
- vzigzag: '⦚',
3132
- wcirc: 'ŵ',
3133
- wedbar: '⩟',
3134
- wedge: '∧',
3135
- wedgeq: '≙',
3136
- weierp: '℘',
3137
- wfr: '𝔴',
3138
- wopf: '𝕨',
3139
- wp: '℘',
3140
- wr: '≀',
3141
- wreath: '≀',
3142
- wscr: '𝓌',
3143
- xcap: '⋂',
3144
- xcirc: '◯',
3145
- xcup: '⋃',
3146
- xdtri: '▽',
3147
- xfr: '𝔵',
3148
- xhArr: '⟺',
3149
- xharr: '⟷',
3150
- xi: 'ξ',
3151
- xlArr: '⟸',
3152
- xlarr: '⟵',
3153
- xmap: '⟼',
3154
- xnis: '⋻',
3155
- xodot: '⨀',
3156
- xopf: '𝕩',
3157
- xoplus: '⨁',
3158
- xotime: '⨂',
3159
- xrArr: '⟹',
3160
- xrarr: '⟶',
3161
- xscr: '𝓍',
3162
- xsqcup: '⨆',
3163
- xuplus: '⨄',
3164
- xutri: '△',
3165
- xvee: '⋁',
3166
- xwedge: '⋀',
3167
- yacute: 'ý',
3168
- yacy: 'я',
3169
- ycirc: 'ŷ',
3170
- ycy: 'ы',
3171
- yen: '¥',
3172
- yfr: '𝔶',
3173
- yicy: 'ї',
3174
- yopf: '𝕪',
3175
- yscr: '𝓎',
3176
- yucy: 'ю',
3177
- yuml: 'ÿ',
3178
- zacute: 'ź',
3179
- zcaron: 'ž',
3180
- zcy: 'з',
3181
- zdot: 'ż',
3182
- zeetrf: 'ℨ',
3183
- zeta: 'ζ',
3184
- zfr: '𝔷',
3185
- zhcy: 'ж',
3186
- zigrarr: '⇝',
3187
- zopf: '𝕫',
3188
- zscr: '𝓏',
3189
- zwj: '‍',
3190
- zwnj: '‌'
3191
- };
3192
- const decode_named_character_reference_own = {}.hasOwnProperty;
3193
- function decodeNamedCharacterReference(value) {
3194
- return decode_named_character_reference_own.call(characterEntities, value) ? characterEntities[value] : false;
3195
- }
3196
- function decodeNumericCharacterReference(value, base) {
3197
- const code = Number.parseInt(value, base);
3198
- if (code < 9 || 11 === code || code > 13 && code < 32 || code > 126 && code < 160 || code > 55295 && code < 57344 || code > 64975 && code < 65008 || (65535 & code) === 65535 || (65535 & code) === 65534 || code > 1114111) return "\uFFFD";
3199
- return String.fromCodePoint(code);
3200
- }
3201
- const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
3202
- function decodeString(value) {
3203
- return value.replace(characterEscapeOrReference, decode);
3204
- }
3205
- function decode($0, $1, $2) {
3206
- if ($1) return $1;
3207
- const head = $2.charCodeAt(0);
3208
- if (35 === head) {
3209
- const head = $2.charCodeAt(1);
3210
- const hex = 120 === head || 88 === head;
3211
- return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);
3212
- }
3213
- return decodeNamedCharacterReference($2) || $0;
3214
- }
3215
- function association(node) {
3216
- if (node.label || !node.identifier) return node.label || '';
3217
- return decodeString(node.identifier);
3218
- }
3219
- function compilePattern(pattern) {
3220
- if (!pattern._compiled) {
3221
- const before = (pattern.atBreak ? '[\\r\\n][\\t ]*' : '') + (pattern.before ? '(?:' + pattern.before + ')' : '');
3222
- pattern._compiled = new RegExp((before ? '(' + before + ')' : '') + (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? '\\' : '') + pattern.character + (pattern.after ? '(?:' + pattern.after + ')' : ''), 'g');
3223
- }
3224
- return pattern._compiled;
3225
- }
3226
- function containerPhrasing(parent, state, info) {
3227
- const indexStack = state.indexStack;
3228
- const children = parent.children || [];
3229
- const results = [];
3230
- let index = -1;
3231
- let before = info.before;
3232
- let encodeAfter;
3233
- indexStack.push(-1);
3234
- let tracker = state.createTracker(info);
3235
- while(++index < children.length){
3236
- const child = children[index];
3237
- let after;
3238
- indexStack[indexStack.length - 1] = index;
3239
- if (index + 1 < children.length) {
3240
- let handle = state.handle.handlers[children[index + 1].type];
3241
- if (handle && handle.peek) handle = handle.peek;
3242
- after = handle ? handle(children[index + 1], parent, state, {
3243
- before: '',
3244
- after: '',
3245
- ...tracker.current()
3246
- }).charAt(0) : '';
3247
- } else after = info.after;
3248
- if (results.length > 0 && ('\r' === before || '\n' === before) && 'html' === child.type) {
3249
- results[results.length - 1] = results[results.length - 1].replace(/(\r?\n|\r)$/, ' ');
3250
- before = ' ';
3251
- tracker = state.createTracker(info);
3252
- tracker.move(results.join(''));
3253
- }
3254
- let value = state.handle(child, parent, state, {
3255
- ...tracker.current(),
3256
- after,
3257
- before
3258
- });
3259
- if (encodeAfter && encodeAfter === value.slice(0, 1)) value = encodeCharacterReference(encodeAfter.charCodeAt(0)) + value.slice(1);
3260
- const encodingInfo = state.attentionEncodeSurroundingInfo;
3261
- state.attentionEncodeSurroundingInfo = void 0;
3262
- encodeAfter = void 0;
3263
- if (encodingInfo) {
3264
- if (results.length > 0 && encodingInfo.before && before === results[results.length - 1].slice(-1)) results[results.length - 1] = results[results.length - 1].slice(0, -1) + encodeCharacterReference(before.charCodeAt(0));
3265
- if (encodingInfo.after) encodeAfter = after;
3266
- }
3267
- tracker.move(value);
3268
- results.push(value);
3269
- before = value.slice(-1);
3270
- }
3271
- indexStack.pop();
3272
- return results.join('');
3273
- }
3274
- function containerFlow(parent, state, info) {
3275
- const indexStack = state.indexStack;
3276
- const children = parent.children || [];
3277
- const tracker = state.createTracker(info);
3278
- const results = [];
3279
- let index = -1;
3280
- indexStack.push(-1);
3281
- while(++index < children.length){
3282
- const child = children[index];
3283
- indexStack[indexStack.length - 1] = index;
3284
- results.push(tracker.move(state.handle(child, parent, state, {
3285
- before: '\n',
3286
- after: '\n',
3287
- ...tracker.current()
3288
- })));
3289
- if ('list' !== child.type) state.bulletLastUsed = void 0;
3290
- if (index < children.length - 1) results.push(tracker.move(container_flow_between(child, children[index + 1], parent, state)));
3291
- }
3292
- indexStack.pop();
3293
- return results.join('');
3294
- }
3295
- function container_flow_between(left, right, parent, state) {
3296
- let index = state.join.length;
3297
- while(index--){
3298
- const result = state.join[index](left, right, parent, state);
3299
- if (true === result || 1 === result) break;
3300
- if ('number' == typeof result) return '\n'.repeat(1 + result);
3301
- if (false === result) return '\n\n<!---->\n\n';
3302
- }
3303
- return '\n\n';
3304
- }
3305
- const eol = /\r?\n|\r/g;
3306
- function indentLines(value, map) {
3307
- const result = [];
3308
- let start = 0;
3309
- let line = 0;
3310
- let match;
3311
- while(match = eol.exec(value)){
3312
- one(value.slice(start, match.index));
3313
- result.push(match[0]);
3314
- start = match.index + match[0].length;
3315
- line++;
3316
- }
3317
- one(value.slice(start));
3318
- return result.join('');
3319
- function one(value) {
3320
- result.push(map(value, line, !value));
3321
- }
3322
- }
3323
- function safe(state, input, config) {
3324
- const value = (config.before || '') + (input || '') + (config.after || '');
3325
- const positions = [];
3326
- const result = [];
3327
- const infos = {};
3328
- let index = -1;
3329
- while(++index < state.unsafe.length){
3330
- const pattern = state.unsafe[index];
3331
- if (!patternInScope(state.stack, pattern)) continue;
3332
- const expression = state.compilePattern(pattern);
3333
- let match;
3334
- while(match = expression.exec(value)){
3335
- const before = 'before' in pattern || Boolean(pattern.atBreak);
3336
- const after = 'after' in pattern;
3337
- const position = match.index + (before ? match[1].length : 0);
3338
- if (positions.includes(position)) {
3339
- if (infos[position].before && !before) infos[position].before = false;
3340
- if (infos[position].after && !after) infos[position].after = false;
3341
- } else {
3342
- positions.push(position);
3343
- infos[position] = {
3344
- before,
3345
- after
3346
- };
3347
- }
3348
- }
3349
- }
3350
- positions.sort(numerical);
3351
- let start = config.before ? config.before.length : 0;
3352
- const end = value.length - (config.after ? config.after.length : 0);
3353
- index = -1;
3354
- while(++index < positions.length){
3355
- const position = positions[index];
3356
- if (position < start || position >= end) continue;
3357
- if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) continue;
3358
- if (start !== position) result.push(escapeBackslashes(value.slice(start, position), '\\'));
3359
- start = position;
3360
- if (!/[!-/:-@[-`{-~]/.test(value.charAt(position)) || config.encode && config.encode.includes(value.charAt(position))) {
3361
- result.push(encodeCharacterReference(value.charCodeAt(position)));
3362
- start++;
3363
- } else result.push('\\');
3364
- }
3365
- result.push(escapeBackslashes(value.slice(start, end), config.after));
3366
- return result.join('');
3367
- }
3368
- function numerical(a, b) {
3369
- return a - b;
3370
- }
3371
- function escapeBackslashes(value, after) {
3372
- const expression = /\\(?=[!-/:-@[-`{-~])/g;
3373
- const positions = [];
3374
- const results = [];
3375
- const whole = value + after;
3376
- let index = -1;
3377
- let start = 0;
3378
- let match;
3379
- while(match = expression.exec(whole))positions.push(match.index);
3380
- while(++index < positions.length){
3381
- if (start !== positions[index]) results.push(value.slice(start, positions[index]));
3382
- results.push('\\');
3383
- start = positions[index];
3384
- }
3385
- results.push(value.slice(start));
3386
- return results.join('');
3387
- }
3388
- function track(config) {
3389
- const options = config || {};
3390
- const now = options.now || {};
3391
- let lineShift = options.lineShift || 0;
3392
- let line = now.line || 1;
3393
- let column = now.column || 1;
3394
- return {
3395
- move,
3396
- current,
3397
- shift
3398
- };
3399
- function current() {
3400
- return {
3401
- now: {
3402
- line,
3403
- column
3404
- },
3405
- lineShift
3406
- };
3407
- }
3408
- function shift(value) {
3409
- lineShift += value;
3410
- }
3411
- function move(input) {
3412
- const value = input || '';
3413
- const chunks = value.split(/\r?\n|\r/g);
3414
- const tail = chunks[chunks.length - 1];
3415
- line += chunks.length - 1;
3416
- column = 1 === chunks.length ? column + tail.length : 1 + tail.length + lineShift;
3417
- return value;
3418
- }
3419
- }
3420
- function toMarkdown(tree, options) {
3421
- const settings = options || {};
3422
- const state = {
3423
- associationId: association,
3424
- containerPhrasing: containerPhrasingBound,
3425
- containerFlow: containerFlowBound,
3426
- createTracker: track,
3427
- compilePattern: compilePattern,
3428
- enter,
3429
- handlers: {
3430
- ...handle_handle
3431
- },
3432
- handle: void 0,
3433
- indentLines: indentLines,
3434
- indexStack: [],
3435
- join: [
3436
- ...join_join
3437
- ],
3438
- options: {},
3439
- safe: safeBound,
3440
- stack: [],
3441
- unsafe: [
3442
- ...unsafe
3443
- ]
3444
- };
3445
- configure(state, settings);
3446
- if (state.options.tightDefinitions) state.join.push(joinDefinition);
3447
- state.handle = zwitch('type', {
3448
- invalid,
3449
- unknown,
3450
- handlers: state.handlers
3451
- });
3452
- let result = state.handle(tree, void 0, state, {
3453
- before: '\n',
3454
- after: '\n',
3455
- now: {
3456
- line: 1,
3457
- column: 1
3458
- },
3459
- lineShift: 0
3460
- });
3461
- if (result && 10 !== result.charCodeAt(result.length - 1) && 13 !== result.charCodeAt(result.length - 1)) result += '\n';
3462
- return result;
3463
- function enter(name) {
3464
- state.stack.push(name);
3465
- return exit;
3466
- function exit() {
3467
- state.stack.pop();
3468
- }
3469
- }
3470
- }
3471
- function invalid(value) {
3472
- throw new Error('Cannot handle value `' + value + '`, expected node');
3473
- }
3474
- function unknown(value) {
3475
- const node = value;
3476
- throw new Error('Cannot handle unknown node `' + node.type + '`');
3477
- }
3478
- function joinDefinition(left, right) {
3479
- if ('definition' === left.type && left.type === right.type) return 0;
3480
- }
3481
- function containerPhrasingBound(parent, info) {
3482
- return containerPhrasing(parent, this, info);
3483
- }
3484
- function containerFlowBound(parent, info) {
3485
- return containerFlow(parent, this, info);
3486
- }
3487
- function safeBound(value, config) {
3488
- return safe(this, value, config);
3489
- }
3490
- function remarkStringify(options) {
3491
- const self = this;
3492
- self.compiler = compiler;
3493
- function compiler(tree) {
3494
- return toMarkdown(tree, {
3495
- ...self.data('settings'),
3496
- ...options,
3497
- extensions: self.data('toMarkdownExtensions') || []
3498
- });
3499
- }
3500
- }
3501
- function remarkSplitMdx(options = {}) {
3502
- return (tree)=>{
3503
- const newChildren = [];
3504
- const importMap = buildImportMap(tree);
3505
- for (const node of tree.children){
3506
- if ('mdxjsEsm' === node.type) {
3507
- newChildren.push(node);
3508
- continue;
3509
- }
3510
- if ('mdxJsxFlowElement' === node.type || 'mdxJsxTextElement' === node.type) {
3511
- const componentName = node.name;
3512
- const shouldKeep = shouldKeepJsxElement(componentName, importMap, options);
3513
- if (shouldKeep) newChildren.push(node);
3514
- else newChildren.push(buildMdxFlowExpressionFragment(node));
3515
- continue;
3516
- }
3517
- const hasJsxChildren = node.children?.some((child)=>'mdxJsxFlowElement' === child.type || 'mdxJsxTextElement' === child.type);
3518
- if (hasJsxChildren) {
3519
- const processedChildren = processMixedContent(node, node.children || [], importMap, options);
3520
- newChildren.push({
3521
- type: 'mdxJsxFlowElement',
3522
- name: null,
3523
- attributes: [],
3524
- children: processedChildren
3525
- });
3526
- } else {
3527
- const fragment = buildMdxFlowExpressionFragment(node);
3528
- newChildren.push(fragment);
3529
- }
3530
- }
3531
- tree.children = newChildren;
3532
- };
3533
- }
3534
- function processMixedContent(parentNode, children, importMap, options) {
3535
- const result = [];
3536
- let textBuffer = [];
3537
- const getPrefix = ()=>{
3538
- if ('heading' === parentNode.type) {
3539
- const depth = parentNode.depth || 1;
3540
- return `${'#'.repeat(depth)} `;
3541
- }
3542
- return '';
3543
- };
3544
- const prefix = getPrefix();
3545
- let prefixAdded = false;
3546
- const flushTextBuffer = ()=>{
3547
- if (textBuffer.length > 0) {
3548
- let combined = textBuffer.join('');
3549
- if (!prefixAdded && prefix) {
3550
- combined = prefix + combined;
3551
- prefixAdded = true;
3552
- }
3553
- if (combined) {
3554
- const stringified = JSON.stringify(combined);
3555
- result.push({
3556
- type: 'mdxTextExpression',
3557
- value: stringified,
3558
- data: {
3559
- estree: {
3560
- type: 'Program',
3561
- body: [
3562
- {
3563
- type: 'ExpressionStatement',
3564
- expression: {
3565
- type: 'Literal',
3566
- value: combined,
3567
- raw: stringified
3568
- }
3569
- }
3570
- ],
3571
- sourceType: 'module'
3572
- }
3573
- }
3574
- });
3575
- }
3576
- textBuffer = [];
3577
- } else if (!prefixAdded && prefix) {
3578
- const trimmedPrefix = prefix.trimEnd();
3579
- const stringified = JSON.stringify(trimmedPrefix);
3580
- result.push({
3581
- type: 'mdxTextExpression',
3582
- value: stringified,
3583
- data: {
3584
- estree: {
3585
- type: 'Program',
3586
- body: [
3587
- {
3588
- type: 'ExpressionStatement',
3589
- expression: {
3590
- type: 'Literal',
3591
- value: trimmedPrefix,
3592
- raw: stringified
3593
- }
3594
- }
3595
- ],
3596
- sourceType: 'module'
3597
- }
3598
- }
3599
- });
3600
- prefixAdded = true;
3601
- }
3602
- };
3603
- for (const child of children)if ('mdxJsxFlowElement' === child.type || 'mdxJsxTextElement' === child.type) {
3604
- flushTextBuffer();
3605
- const componentName = child.name;
3606
- const shouldKeep = shouldKeepJsxElement(componentName, importMap, options);
3607
- if (shouldKeep) result.push(child);
3608
- else {
3609
- const fragment = buildMdxFlowExpressionFragment(child);
3610
- result.push(fragment);
3611
- }
3612
- } else if ('text' === child.type) textBuffer.push(child.value || '');
3613
- else {
3614
- const serialized = serializeNodeToMarkdown(child);
3615
- if (serialized) textBuffer.push(serialized);
3616
- }
3617
- flushTextBuffer();
3618
- return result;
3619
- }
3620
- function buildMdxFlowExpressionFragment(node) {
3621
- const textContent = serializeNodeToMarkdown(node);
3622
- const stringified = JSON.stringify(textContent);
3623
- const fragment = {
3624
- type: 'mdxFlowExpression',
3625
- value: stringified,
3626
- data: {
3627
- estree: {
3628
- type: 'Program',
3629
- body: [
3630
- {
3631
- type: 'ExpressionStatement',
3632
- expression: {
3633
- type: 'Literal',
3634
- value: textContent,
3635
- raw: stringified
3636
- }
3637
- }
3638
- ],
3639
- sourceType: 'module'
3640
- }
3641
- }
3642
- };
3643
- return fragment;
3644
- }
3645
- const processor = unified().use(remark_mdx).use(remark_gfm).use(remarkStringify, {
3646
- bullet: '-',
3647
- emphasis: '_',
3648
- fences: true,
3649
- incrementListMarker: true
3650
- });
3651
- function serializeNodeToMarkdown(node) {
3652
- const tempRoot = {
3653
- type: 'root',
3654
- children: [
3655
- node
3656
- ]
3657
- };
3658
- const result = processor.stringify(tempRoot);
3659
- return result;
3660
- }
3661
- function buildImportMap(tree) {
3662
- const importMap = new Map();
3663
- for (const node of tree.children)if ('mdxjsEsm' === node.type && node.data?.estree) {
3664
- const estree = node.data.estree;
3665
- for (const statement of estree.body)if ('ImportDeclaration' === statement.type) {
3666
- const source = statement.source.value;
3667
- for (const specifier of statement.specifiers){
3668
- let localName = null;
3669
- if ('ImportDefaultSpecifier' === specifier.type) localName = specifier.local.name;
3670
- else if ('ImportSpecifier' === specifier.type) localName = specifier.local.name;
3671
- else if ('ImportNamespaceSpecifier' === specifier.type) localName = specifier.local.name;
3672
- if (localName) importMap.set(localName, source);
3673
- }
3674
- }
3675
- }
3676
- return importMap;
3677
- }
3678
- function shouldKeepJsxElement(componentName, importMap, options) {
3679
- if (!componentName) return true;
3680
- const { includes, excludes } = options;
3681
- if (!includes && !excludes) return true;
3682
- const importSource = importMap.get(componentName);
3683
- if (importSource?.endsWith('.mdx')) return true;
3684
- if (excludes) {
3685
- for (const [excludeSpecifiers, excludeSource] of excludes)if (excludeSpecifiers.includes(componentName)) {
3686
- if (!importSource || importSource === excludeSource) return false;
3687
- }
3688
- }
3689
- if (includes) {
3690
- let matchesAnyRule = false;
3691
- for (const [includeSpecifiers, includeSource] of includes)if (includeSpecifiers.includes(componentName)) {
3692
- if (!importSource || importSource === includeSource) {
3693
- matchesAnyRule = true;
3694
- break;
3695
- }
3696
- }
3697
- if (!matchesAnyRule) return false;
3698
- }
3699
- return true;
3700
- }
3701
- const rehypeCodeMeta = ()=>(tree)=>{
3702
- visit(tree, 'element', (node)=>{
3703
- if ('pre' === node.tagName && node.children[0]?.type === 'element' && 'code' === node.children[0].tagName) {
3704
- const codeNode = node.children[0];
3705
- codeNode.properties.metastring = codeNode.data?.meta;
3706
- }
3707
- });
3708
- };
3709
- const rehypeHeaderAnchor = ()=>{
3710
- const slugger = new github_slugger();
3711
- return (tree)=>{
3712
- visit(tree, 'element', (node)=>{
3713
- if (!headingRank(node)) return;
3714
- if (!node.properties?.id) {
3715
- const [text, customId] = collectHeaderText(node);
3716
- node.properties ??= {};
3717
- node.properties.id = customId || slugger.slug(text.trim());
3718
- }
3719
- node.children.unshift(create(node));
3720
- });
3721
- };
3722
- };
3723
- const collectHeaderText = (node)=>{
3724
- let text = '';
3725
- let id = '';
3726
- node.children.forEach((child)=>{
3727
- if ('text' === child.type) {
3728
- const [textPart, idPart] = extractTextAndId(child.value);
3729
- child.value = textPart;
3730
- text += textPart;
3731
- id = idPart;
3732
- } else if ('element' === child.type) child.children.forEach((c)=>{
3733
- if ('text' === c.type) text += c.value;
3734
- });
3735
- });
3736
- return [
3737
- text,
3738
- id
3739
- ];
3740
- };
3741
- function create(node) {
3742
- return {
3743
- type: 'element',
3744
- tagName: 'a',
3745
- properties: {
3746
- class: 'rp-header-anchor',
3747
- ariaHidden: 'true',
3748
- href: `#${node.properties.id}`
3749
- },
3750
- children: [
3751
- {
3752
- type: 'text',
3753
- value: '#'
3754
- }
3755
- ]
3756
- };
3757
- }
3758
- const SHIKI_TRANSFORMER_ADD_LANG = 'shiki-transformer:add-lang';
3759
- function transformerAddLang() {
3760
- return {
3761
- name: SHIKI_TRANSFORMER_ADD_LANG,
3762
- pre (pre) {
3763
- const lang = this.options.lang;
3764
- if (lang.length > 0) pre.properties = {
3765
- ...pre.properties,
3766
- lang
3767
- };
3768
- return pre;
3769
- }
3770
- };
3771
- }
3772
- const SHIKI_TRANSFORMER_ADD_LINE_NUMBERS = 'shiki-transformer:add-line-numbers';
3773
- function hasLineNumbersInMeta(meta) {
3774
- if (!meta) return;
3775
- const kvList = meta.split(' ').filter(Boolean);
3776
- return kvList.includes('lineNumbers');
3777
- }
3778
- function transformerAddLineNumbers(options = {}) {
3779
- const { defaultShowLineNumbers = false } = options;
3780
- return {
3781
- name: SHIKI_TRANSFORMER_ADD_LINE_NUMBERS,
3782
- pre (pre) {
3783
- const metaHasLineNumbers = hasLineNumbersInMeta(this.options.meta?.__raw);
3784
- const shouldShowLineNumbers = metaHasLineNumbers ?? defaultShowLineNumbers;
3785
- if (shouldShowLineNumbers) pre.properties = {
3786
- ...pre.properties,
3787
- lineNumbers: shouldShowLineNumbers
3788
- };
3789
- return pre;
3790
- }
3791
- };
3792
- }
3793
- const SHIKI_TRANSFORMER_ADD_TITLE = 'shiki-transformer:add-title';
3794
- function parseTitleFromMeta(meta) {
3795
- if (!meta) return '';
3796
- const kvList = meta.split(' ').filter(Boolean);
3797
- for (const item of kvList){
3798
- const [k, v = ''] = item.split('=').filter(Boolean);
3799
- if ('title' === k && v.length > 0) return v.replace(/["'`]/g, '');
3800
- }
3801
- return '';
3802
- }
3803
- function transformerAddTitle() {
3804
- return {
3805
- name: SHIKI_TRANSFORMER_ADD_TITLE,
3806
- pre (pre) {
3807
- const title = parseTitleFromMeta(this.options.meta?.__raw);
3808
- if (title.length > 0) pre.properties = {
3809
- ...pre.properties,
3810
- title
3811
- };
3812
- return pre;
3813
- }
3814
- };
3815
- }
3816
- const SHIKI_TRANSFORMER_ADD_WRAP_CODE = 'shiki-transformer:wrap-code';
3817
- function hasWrapCodeInMeta(meta) {
3818
- if (!meta) return;
3819
- const kvList = meta.split(' ').filter(Boolean);
3820
- return kvList.includes('wrapCode');
3821
- }
3822
- function transformerAddWrapCode(options = {}) {
3823
- const { defaultWrapCode = false } = options;
3824
- return {
3825
- name: SHIKI_TRANSFORMER_ADD_WRAP_CODE,
3826
- pre (pre) {
3827
- const metaHasWrapCode = hasWrapCodeInMeta(this.options.meta?.__raw);
3828
- const shouldWrapCode = metaHasWrapCode ?? defaultWrapCode;
3829
- if (shouldWrapCode) pre.properties = {
3830
- ...pre.properties,
3831
- wrapCode: true
3832
- };
3833
- return pre;
3834
- }
3835
- };
3836
- }
3837
- const cssVariablesTheme = createCssVariablesTheme({
3838
- name: 'css-variables',
3839
- variablePrefix: '--shiki-',
3840
- variableDefaults: {},
3841
- fontStyle: true
3842
- });
3843
- function createRehypeShikiOptions(showLineNumbers, defaultWrapCode, options) {
3844
- const { transformers = [], ...restOptions } = options || {};
3845
- const newTransformers = [
3846
- transformerAddTitle(),
3847
- transformerAddLang(),
3848
- transformerAddLineNumbers({
3849
- defaultShowLineNumbers: showLineNumbers
3850
- }),
3851
- transformerAddWrapCode({
3852
- defaultWrapCode
3853
- }),
3854
- ...transformers
3855
- ];
3856
- return {
3857
- theme: cssVariablesTheme,
3858
- defaultLanguage: 'txt',
3859
- lazy: true,
3860
- langs: [
3861
- 'tsx',
3862
- 'ts',
3863
- 'js'
3864
- ],
3865
- ...restOptions,
3866
- transformers: newTransformers
3867
- };
3868
- }
3869
- const getDefaultImportAstNode = (name, from)=>({
3870
- type: 'mdxjsEsm',
3871
- value: `import ${name} from ${JSON.stringify(from)}`,
3872
- data: {
3873
- estree: {
3874
- type: 'Program',
3875
- sourceType: 'module',
3876
- body: [
3877
- {
3878
- type: 'ImportDeclaration',
3879
- specifiers: [
3880
- {
3881
- type: 'ImportDefaultSpecifier',
3882
- local: {
3883
- type: 'Identifier',
3884
- name
3885
- }
3886
- }
3887
- ],
3888
- source: {
3889
- type: 'Literal',
3890
- value: from,
3891
- raw: `${JSON.stringify(from)}`
3892
- }
3893
- }
3894
- ]
3895
- }
3896
- }
3897
- });
3898
- const getNamedImportAstNode = (name, alias, from)=>({
3899
- type: 'mdxjsEsm',
3900
- value: `import { ${name} as ${alias} } from ${JSON.stringify(from)}`,
3901
- data: {
3902
- estree: {
3903
- type: 'Program',
3904
- sourceType: 'module',
3905
- body: [
3906
- {
3907
- type: 'ImportDeclaration',
3908
- specifiers: [
3909
- {
3910
- type: 'ImportSpecifier',
3911
- imported: {
3912
- type: 'Identifier',
3913
- name
3914
- },
3915
- local: {
3916
- type: 'Identifier',
3917
- name: alias
3918
- }
3919
- }
3920
- ],
3921
- source: {
3922
- type: 'Literal',
3923
- value: from,
3924
- raw: `${JSON.stringify(from)}`
3925
- }
3926
- }
3927
- ]
3928
- }
3929
- }
3930
- });
3931
- const remarkBuiltin = ({ globalComponents })=>(tree)=>{
3932
- const demos = globalComponents.map((componentPath)=>{
3933
- const filename = node_path.parse(componentPath).name;
3934
- const componentName = filename[0].toUpperCase() + filename.slice(1);
3935
- return getDefaultImportAstNode(componentName, componentPath);
3936
- });
3937
- tree.children.unshift(...demos);
3938
- };
3939
- const DIRECTIVE_TYPES = [
3940
- 'tip',
3941
- 'note',
3942
- 'warning',
3943
- 'caution',
3944
- 'danger',
3945
- 'info',
3946
- 'details'
3947
- ];
3948
- const REGEX_BEGIN = /^\s*:::\s*(\w+)\s*(.*)?/;
3949
- const REGEX_END = /\s*:::$/;
3950
- const REGEX_GH_BEGIN = /^\s*\s*\[!(\w+)\]\s*(.*)?/;
3951
- const TITLE_REGEX_IN_MD = /{\s*title=["']?(.+)}\s*/;
3952
- const TITLE_REGEX_IN_MDX = /\s*title=["']?(.+)\s*/;
3953
- const CALLOUT_COMPONENT = '$$$callout$$$';
3954
- const trimTailingQuote = (str)=>str.replace(/['"]$/g, '');
3955
- const parseTitle = (rawTitle = '', isMDX = false)=>{
3956
- const matched = rawTitle?.match(isMDX ? TITLE_REGEX_IN_MDX : TITLE_REGEX_IN_MD);
3957
- return trimTailingQuote(matched?.[1] || rawTitle);
3958
- };
3959
- const getTypeName = (type)=>type[0].toUpperCase() + type.slice(1).toLowerCase();
3960
- const createContainer = (type, title, children)=>({
3961
- type: 'containerDirective',
3962
- name: CALLOUT_COMPONENT,
3963
- attributes: {
3964
- type: type,
3965
- title: title || getTypeName(type)
3966
- },
3967
- data: {
3968
- hName: CALLOUT_COMPONENT,
3969
- hProperties: {
3970
- type: type,
3971
- title: title || getTypeName(type)
3972
- }
3973
- },
3974
- children: children
3975
- });
3976
- function transformer(tree, warnUnknownType) {
3977
- let i = 0;
3978
- while(i < tree.children.length){
3979
- const node = tree.children[i];
3980
- if ('children' in node) transformer(node, warnUnknownType);
3981
- if ('containerDirective' === node.type) {
3982
- const type = node.name;
3983
- if (type === CALLOUT_COMPONENT) {
3984
- i++;
3985
- continue;
3986
- }
3987
- if (DIRECTIVE_TYPES.includes(type)) tree.children.splice(i, 1, createContainer(type, node.attributes?.title ?? type.toUpperCase(), node.children));
3988
- else warnUnknownType(type);
3989
- } else if ('blockquote' === node.type && node.children[0]?.type === 'paragraph' && node.children[0].children?.[0] && 'value' in node.children[0].children[0]) {
3990
- const initiatorTag = node.children[0].children[0].value;
3991
- const match = initiatorTag.match(REGEX_GH_BEGIN);
3992
- if (match) {
3993
- const [, type] = match;
3994
- if (!DIRECTIVE_TYPES.includes(type.toLowerCase())) {
3995
- warnUnknownType(type);
3996
- i++;
3997
- continue;
3998
- }
3999
- if (1 === node.children.length && 'paragraph' === node.children[0].type) node.children[0].children[0].value = match[2] ?? '';
4000
- const newChild = createContainer(type.toLowerCase(), type.toUpperCase(), 0 === node.children.slice(1).length ? node.children.slice(0) : node.children.slice(1));
4001
- tree.children.splice(i, 1, newChild);
4002
- }
4003
- }
4004
- if ('paragraph' !== node.type || 'text' !== node.children[0].type) {
4005
- i++;
4006
- continue;
4007
- }
4008
- const firstTextNode = node.children[0];
4009
- const text = firstTextNode.value;
4010
- const metaText = text.split('\n')[0];
4011
- const content = text.slice(metaText.length);
4012
- const match = metaText.match(REGEX_BEGIN);
4013
- if (!match) {
4014
- i++;
4015
- continue;
4016
- }
4017
- const [, type, rawTitle] = match;
4018
- let title = parseTitle(rawTitle);
4019
- const titleExpressionNode = node.children[1] && 'mdxTextExpression' === node.children[1].type ? node.children[1] : null;
4020
- if (titleExpressionNode) {
4021
- title = parseTitle(titleExpressionNode.value, true);
4022
- node.children.splice(1, 1);
4023
- }
4024
- if (!DIRECTIVE_TYPES.includes(type)) {
4025
- warnUnknownType(type);
4026
- i++;
4027
- continue;
4028
- }
4029
- const wrappedChildren = [];
4030
- if (content?.endsWith(':::')) {
4031
- wrappedChildren.push({
4032
- type: 'paragraph',
4033
- children: [
4034
- {
4035
- type: 'text',
4036
- value: content.replace(REGEX_END, '')
4037
- }
4038
- ]
4039
- });
4040
- const newChild = createContainer(type, title, wrappedChildren);
4041
- tree.children.splice(i, 1, newChild);
4042
- } else {
4043
- const paragraphChild = {
4044
- type: 'paragraph',
4045
- children: []
4046
- };
4047
- wrappedChildren.push(paragraphChild);
4048
- if (content.length) paragraphChild.children.push({
4049
- type: 'text',
4050
- value: content
4051
- });
4052
- paragraphChild.children.push(...node.children.slice(1, -1));
4053
- if (0 === paragraphChild.children.length) wrappedChildren.pop();
4054
- const lastChildInNode = node.children[node.children.length - 1];
4055
- if ('text' === lastChildInNode.type && REGEX_END.test(lastChildInNode.value)) {
4056
- const lastChildInNodeText = lastChildInNode.value;
4057
- const matchedEndContent = lastChildInNodeText.slice(0, -3).trimEnd();
4058
- if (wrappedChildren.length) wrappedChildren[0].children.push({
4059
- type: 'text',
4060
- value: matchedEndContent
4061
- });
4062
- else if (matchedEndContent) wrappedChildren.push({
4063
- type: 'paragraph',
4064
- children: [
4065
- {
4066
- type: 'text',
4067
- value: matchedEndContent
4068
- }
4069
- ]
4070
- });
4071
- const newChild = createContainer(type, title, wrappedChildren);
4072
- tree.children.splice(i, 1, newChild);
4073
- i++;
4074
- continue;
4075
- }
4076
- if (lastChildInNode !== firstTextNode && wrappedChildren.length) wrappedChildren[0].children.push(lastChildInNode);
4077
- let j = i + 1;
4078
- while(j < tree.children.length){
4079
- const currentParagraph = tree.children[j];
4080
- if ('paragraph' !== currentParagraph.type) {
4081
- wrappedChildren.push(currentParagraph);
4082
- j++;
4083
- continue;
4084
- }
4085
- const lastChild = currentParagraph.children[currentParagraph.children.length - 1];
4086
- if (lastChild === firstTextNode || 'text' === lastChild.type && REGEX_END.test(lastChild.value)) {
4087
- const lastChildText = lastChild.value;
4088
- const matchedEndContent = lastChildText.slice(0, -3).trimEnd();
4089
- const filteredChildren = currentParagraph.children.filter((child)=>child !== firstTextNode && child !== lastChild);
4090
- if (matchedEndContent) wrappedChildren.push({
4091
- type: 'paragraph',
4092
- children: [
4093
- ...filteredChildren,
4094
- {
4095
- type: 'text',
4096
- value: matchedEndContent
4097
- }
4098
- ]
4099
- });
4100
- else wrappedChildren.push(...filteredChildren);
4101
- const newChild = createContainer(type, title, wrappedChildren);
4102
- tree.children.splice(i, j - i + 1, newChild);
4103
- break;
4104
- }
4105
- wrappedChildren.push({
4106
- ...currentParagraph,
4107
- children: currentParagraph.children.filter((child)=>child !== firstTextNode)
4108
- });
4109
- j++;
4110
- }
4111
- }
4112
- i++;
4113
- }
4114
- }
4115
- const remarkContainerSyntax = ()=>{
4116
- const unknownTypes = new Set();
4117
- const warnUnknownType = (type)=>{
4118
- if (!type || type === CALLOUT_COMPONENT) return;
4119
- if (unknownTypes.has(type)) return;
4120
- unknownTypes.add(type);
4121
- };
4122
- return (tree)=>{
4123
- transformer(tree, warnUnknownType);
4124
- tree.children.unshift(getNamedImportAstNode('Callout', CALLOUT_COMPONENT, '@theme'));
4125
- };
4126
- };
4127
- const ERROR_PREFIX = '[remarkFileCodeBlock]';
4128
- function parseFileFromMeta(meta) {
4129
- if (!meta) return '';
4130
- const kvList = meta.split(' ').filter(Boolean);
4131
- for (const item of kvList){
4132
- const [k, v = ''] = item.split('=');
4133
- if ('file' === k && v.length > 0) return v.replace(/["'`]/g, '');
4134
- }
4135
- return '';
4136
- }
4137
- const remarkFileCodeBlock = ({ filepath, addDependency })=>async (tree)=>{
4138
- const promiseList = [];
4139
- visit(tree, 'code', (node)=>{
4140
- const { meta, value, lang } = node;
4141
- const file = parseFileFromMeta(meta ?? '');
4142
- if (!file) return;
4143
- const originalMetaForErrorInfo = picocolors_0.cyan(`\`\`\`${lang} ${meta}`);
4144
- if (file.startsWith('./') || file.startsWith('../')) {
4145
- const resolvedFilePath = node_path.join(node_path.dirname(filepath), file);
4146
- if ('' !== value.trim()) {
4147
- logger_logger.error(`${ERROR_PREFIX} ${originalMetaForErrorInfo} The content of file code block should be empty.
4148
-
4149
- \`\`\`tsx file="./filename"
4150
- content
4151
- \`\`\`
4152
-
4153
- this usage is not allowed, please use below:
4154
-
4155
- \`\`\`tsx file="./filename"
4156
- \`\`\`
4157
- `);
4158
- throw new Error(`${ERROR_PREFIX} ${originalMetaForErrorInfo} The content of file code block should be empty.`);
4159
- }
4160
- const promise = promises_readFile(resolvedFilePath, 'utf-8').then((fileContent)=>{
4161
- addDependency?.(resolvedFilePath);
4162
- node.value = fileContent;
4163
- }).catch((e)=>{
4164
- const message = `${ERROR_PREFIX} ${originalMetaForErrorInfo} introduces another file in "${resolvedFilePath}", but the file does not exist.`;
4165
- logger_logger.error(message);
4166
- e.message = `${message}\n${e.message}`;
4167
- throw e;
4168
- });
4169
- promiseList.push(promise);
4170
- return;
4171
- }
4172
- logger_logger.error(`${ERROR_PREFIX} ${originalMetaForErrorInfo} syntax error of file code block:
4173
- Please use below:
4174
-
4175
- \`\`\`tsx file="./filename"
4176
- \`\`\`
4177
- `);
4178
- throw new Error(`${ERROR_PREFIX} ${originalMetaForErrorInfo} syntax error of file code block`);
4179
- });
4180
- await Promise.all(promiseList);
4181
- };
4182
- const normalizeImageUrl = (imageUrl)=>{
4183
- if (isExternalUrl(imageUrl) || imageUrl.startsWith('/')) return '';
4184
- return imageUrl;
4185
- };
4186
- const remarkImage = ()=>(tree, _file)=>{
4187
- const images = [];
4188
- const getMdxSrcAttribute = (tempVar)=>({
4189
- type: 'mdxJsxAttribute',
4190
- name: 'src',
4191
- value: {
4192
- type: 'mdxJsxAttributeValueExpression',
4193
- value: tempVar,
4194
- data: {
4195
- estree: {
4196
- type: 'Program',
4197
- sourceType: 'module',
4198
- body: [
4199
- {
4200
- type: 'ExpressionStatement',
4201
- expression: {
4202
- type: 'Identifier',
4203
- name: tempVar
4204
- }
4205
- }
4206
- ]
4207
- }
4208
- }
4209
- }
4210
- });
4211
- visit(tree, 'image', (node)=>{
4212
- const { alt, url } = node;
4213
- if (!url) return;
4214
- const imagePath = normalizeImageUrl(url);
4215
- if (!imagePath) return;
4216
- const tempVariableName = `image${images.length}`;
4217
- Object.assign(node, {
4218
- type: 'mdxJsxFlowElement',
4219
- name: 'img',
4220
- children: [],
4221
- attributes: [
4222
- alt && {
4223
- type: 'mdxJsxAttribute',
4224
- name: 'alt',
4225
- value: alt
4226
- },
4227
- getMdxSrcAttribute(tempVariableName)
4228
- ].filter(Boolean)
4229
- });
4230
- images.push(getDefaultImportAstNode(tempVariableName, imagePath));
4231
- });
4232
- visit(tree, (node)=>{
4233
- if ('mdxJsxFlowElement' !== node.type && 'mdxJsxTextElement' !== node.type || 'img' !== node.name) return;
4234
- const srcAttr = getNodeAttribute(node, 'src', true);
4235
- if ('string' != typeof srcAttr?.value) return;
4236
- const imagePath = normalizeImageUrl(srcAttr.value);
4237
- if (!imagePath) return;
4238
- const tempVariableName = `image${images.length}`;
4239
- Object.assign(srcAttr, getMdxSrcAttribute(tempVariableName));
4240
- images.push(getDefaultImportAstNode(tempVariableName, imagePath));
4241
- });
4242
- tree.children.unshift(...images);
4243
- };
4244
- let isLogged = false;
4245
- function hintRelativeMarkdownLink() {
4246
- if (isLogged) return;
4247
- isLogged = true;
4248
- logger_logger.info('[Rspress v2] Markdown links without "./" prefix are now relative links, e.g: [](guide/getting-started) is equal to [](./guide/getting-started). You can rewrite it to [](/guide/getting-started) to always use absolute links, or use [](./getting-started.md)');
4249
- }
4250
- function link_checkDeadLinks(checkDeadLinks, internalLinks, file, lint) {
4251
- const errorInfos = [];
4252
- const excludes = 'object' == typeof checkDeadLinks ? checkDeadLinks.excludes : void 0;
4253
- const excludesUrl = Array.isArray(excludes) ? new Set(excludes) : void 0;
4254
- const excludesFn = 'function' == typeof excludes ? excludes : void 0;
4255
- let possibleBreakingChange = false;
4256
- [
4257
- ...internalLinks.entries()
4258
- ].forEach(([nodeUrl, link])=>{
4259
- if (excludesUrl?.has(nodeUrl)) return;
4260
- if (excludesFn?.(nodeUrl)) return;
4261
- if (!nodeUrl.startsWith('/') && /^\w/.test(nodeUrl)) possibleBreakingChange = true;
4262
- errorInfos.push([
4263
- nodeUrl,
4264
- link
4265
- ]);
4266
- });
4267
- if (errorInfos.length > 0) {
4268
- if (possibleBreakingChange) hintRelativeMarkdownLink();
4269
- const message = `Dead links found${lint ? '' : ` in ${picocolors_0.cyan(file.path)}`}:
4270
- ${errorInfos.map(([nodeUrl, link])=>` ${picocolors_0.green(`"[..](${nodeUrl})"`)} ${picocolors_0.gray(link)}`).join('\n')}`;
4271
- if (lint) file.message(message);
4272
- else {
4273
- logger_logger.error(message);
4274
- if (isProduction()) throw new Error('Dead link found');
4275
- }
4276
- }
4277
- }
4278
- function looseMarkdownLink(url, routeService, filePath) {
4279
- if (!routeService.isInDocsDir(filePath)) return url;
4280
- const [versionPart, langPart, pureRoute] = routeService.splitRoutePathParts(url);
4281
- const relativePath = routeService.absolutePathToRelativePath(filePath);
4282
- const [versionPartCurrFile, langPartCurrFile] = routeService.getRoutePathParts(relativePath);
4283
- if ('' === versionPart) {
4284
- if ('' === langPart) return addLeadingSlash(`${[
4285
- versionPartCurrFile,
4286
- langPartCurrFile
4287
- ].filter(Boolean).join('/')}${addLeadingSlash(pureRoute.replace(/^\/*/, ''))}`);
4288
- return addLeadingSlash(`${[
4289
- versionPartCurrFile,
4290
- langPart
4291
- ].filter(Boolean).join('/')}${addLeadingSlash(pureRoute.replace(/^\/*/, ''))}`);
4292
- }
4293
- return url;
4294
- }
4295
- function normalizeLink(nodeUrl, routeService, filePath, cleanUrls, autoPrefix, deadLinks, __base) {
4296
- if (!nodeUrl) return '';
4297
- if (nodeUrl.startsWith('#')) return nodeUrl;
4298
- if (isExternalUrl(nodeUrl)) return nodeUrl;
4299
- if (!routeService) return nodeUrl;
4300
- let { url, hash, search } = parseUrl(nodeUrl);
4301
- if (url.startsWith('/')) {
4302
- if (autoPrefix) url = looseMarkdownLink(url, routeService, filePath);
4303
- const { routePath } = routeService.normalizeRoutePath(url);
4304
- url = routePath;
4305
- } else {
4306
- const anotherFileAbsolutePath = node_path.join(node_path.dirname(filePath), url);
4307
- url = routeService.absolutePathToRoutePath(anotherFileAbsolutePath);
4308
- }
4309
- if ('boolean' == typeof cleanUrls) {
4310
- url = normalizeHref(url, cleanUrls);
4311
- if (!routeService.isExistRoute(url)) {
4312
- deadLinks.set(nodeUrl, url);
4313
- return nodeUrl;
4314
- }
4315
- } else {
4316
- url = normalizeHref(url, false);
4317
- if (!routeService.isExistRoute(url)) {
4318
- deadLinks.set(nodeUrl, url);
4319
- return nodeUrl;
4320
- }
4321
- url = url.replace(/\.html$/, cleanUrls);
4322
- }
4323
- if (search) url += `?${search}`;
4324
- if (hash) url += `#${hash}`;
4325
- if (__base) url = withBase(url, __base);
4326
- return url;
4327
- }
4328
- const remarkLink = ({ cleanUrls, routeService, remarkLinkOptions, lint, __base })=>(tree, file)=>{
4329
- const { checkDeadLinks: shouldCheckDeadLinks = true, autoPrefix = true } = remarkLinkOptions ?? {};
4330
- const deadLinks = new Map();
4331
- visit(tree, 'link', (node)=>{
4332
- const { url: nodeUrl } = node;
4333
- const link = normalizeLink(nodeUrl, routeService, file.path, cleanUrls, autoPrefix, deadLinks, __base);
4334
- node.url = link;
4335
- });
4336
- visit(tree, 'definition', (node)=>{
4337
- const { url: nodeUrl } = node;
4338
- const link = normalizeLink(nodeUrl, routeService, file.path, cleanUrls, autoPrefix, deadLinks, __base);
4339
- node.url = link;
4340
- });
4341
- if (shouldCheckDeadLinks && routeService) link_checkDeadLinks(shouldCheckDeadLinks, deadLinks, file, lint);
4342
- };
4343
- const parseToc = (tree)=>{
4344
- let title = '';
4345
- const toc = [];
4346
- const slugger = new github_slugger();
4347
- visitChildren((node)=>{
4348
- if ('heading' !== node.type || !node.depth || !node.children) return;
4349
- if (node.depth >= 1 && node.depth < 5) {
4350
- let customId = '';
4351
- const text = node.children.map((child)=>{
4352
- if ('link' === child.type) return child.children?.map((item)=>item.value).join('');
4353
- if ('strong' === child.type) return `**${child.children?.map((item)=>item.value).join('')}**`;
4354
- if ('emphasis' === child.type) return `*${child.children?.map((item)=>item.value).join('')}*`;
4355
- if ('delete' === child.type) return `~~${child.children?.map((item)=>item.value).join('')}~~`;
4356
- if ('text' === child.type) {
4357
- const [textPart, idPart] = extractTextAndId(child.value);
4358
- customId = idPart;
4359
- return textPart;
4360
- }
4361
- if ('inlineCode' === child.type) return `\`${child.value}\``;
4362
- return '';
4363
- }).join('');
4364
- if (1 === node.depth) {
4365
- if (!title) title = text;
4366
- } else {
4367
- const id = customId ? customId : slugger.slug(text.trim());
4368
- const { depth } = node;
4369
- toc.push({
4370
- id,
4371
- text,
4372
- depth
4373
- });
4374
- }
4375
- }
4376
- })(tree);
4377
- return {
4378
- title,
4379
- toc
4380
- };
4381
- };
4382
- const remarkToc = function() {
4383
- const data = this.data();
4384
- return (tree)=>{
4385
- const { toc, title } = parseToc(tree);
4386
- data.pageMeta.toc = toc;
4387
- if (title) data.pageMeta.title = title;
4388
- };
4389
- };
4390
- async function createMDXOptions(options) {
4391
- const { docDirectory, config, routeService, filepath, pluginDriver, addDependency, isSsgMd = false } = options;
4392
- const remarkLinkOptions = config?.markdown?.link;
4393
- const format = node_path.extname(filepath).slice(1);
4394
- const { remarkPlugins: remarkPluginsFromConfig = [], rehypePlugins: rehypePluginsFromConfig = [], globalComponents: globalComponentsFromConfig = [], showLineNumbers = false, defaultWrapCode = false, shiki } = config?.markdown || {};
4395
- const rspressPlugins = pluginDriver?.getPlugins() ?? [];
4396
- const remarkPluginsFromPlugins = rspressPlugins.flatMap((plugin)=>plugin.markdown?.remarkPlugins || []);
4397
- const rehypePluginsFromPlugins = rspressPlugins.flatMap((plugin)=>plugin.markdown?.rehypePlugins || []);
4398
- const globalComponents = [
4399
- ...rspressPlugins.flatMap((plugin)=>plugin.markdown?.globalComponents || []),
4400
- ...globalComponentsFromConfig
4401
- ];
4402
- return {
4403
- providerImportSource: '@mdx-js/react',
4404
- format,
4405
- remarkPlugins: [
4406
- remark_gfm,
4407
- remarkToc,
4408
- !isSsgMd && remarkContainerSyntax,
4409
- [
4410
- remarkFileCodeBlock,
4411
- {
4412
- filepath,
4413
- addDependency
4414
- }
4415
- ],
4416
- [
4417
- remarkLink,
4418
- isSsgMd ? {
4419
- cleanUrls: '.md',
4420
- root: docDirectory,
4421
- routeService,
4422
- remarkLinkOptions: {
4423
- checkDeadLinks: false,
4424
- autoPrefix: true
4425
- }
4426
- } : {
4427
- cleanUrls: false,
4428
- root: docDirectory,
4429
- routeService,
4430
- remarkLinkOptions
4431
- }
4432
- ],
4433
- remarkImage,
4434
- isSsgMd && [
4435
- remarkSplitMdx,
4436
- 'object' == typeof config?.llms ? config.llms.remarkSplitMdxOptions : void 0
4437
- ],
4438
- globalComponents.length && [
4439
- remarkBuiltin,
4440
- {
4441
- globalComponents
4442
- }
4443
- ],
4444
- ...remarkPluginsFromConfig,
4445
- ...remarkPluginsFromPlugins
4446
- ].filter(Boolean),
4447
- ...isSsgMd ? {} : {
4448
- rehypePlugins: [
4449
- rehypeHeaderAnchor,
4450
- ...'md' === format ? [
4451
- rehypeCodeMeta,
4452
- [
4453
- rehype_raw,
4454
- {
4455
- passThrough: nodeTypes
4456
- }
4457
- ]
4458
- ] : [],
4459
- [
4460
- rehype,
4461
- createRehypeShikiOptions(showLineNumbers, defaultWrapCode, shiki)
4462
- ],
4463
- [
4464
- rehype_external_links,
4465
- {
4466
- target: '_blank',
4467
- rel: 'noopener noreferrer'
4468
- }
4469
- ],
4470
- ...rehypePluginsFromConfig,
4471
- ...rehypePluginsFromPlugins
4472
- ]
4473
- }
4474
- };
4475
- }
4476
- async function compile(options) {
4477
- const { source, filepath, docDirectory, config, routeService, pluginDriver, addDependency, isSsgMd = false } = options;
4478
- const mdxOptions = await createMDXOptions({
4479
- config,
4480
- docDirectory,
4481
- filepath,
4482
- pluginDriver,
4483
- routeService,
4484
- addDependency,
4485
- isSsgMd
4486
- });
4487
- const { frontmatter, emptyLinesSource } = loadFrontMatter(source, filepath, docDirectory, true);
4488
- const { replaceRules } = config ?? {};
4489
- const replacedSource = applyReplaceRules(emptyLinesSource, replaceRules);
4490
- const preprocessedContent = escapeMarkdownHeadingIds(replacedSource);
4491
- try {
4492
- let pageMeta = {
4493
- title: '',
4494
- toc: [],
4495
- headingTitle: ''
4496
- };
4497
- const frontmatterTitle = extractTextAndId(frontmatter.title)[0];
4498
- const compiler = createProcessor(mdxOptions);
4499
- compiler.data('pageMeta', {
4500
- toc: [],
4501
- title: ''
4502
- });
4503
- const vFile = await compiler.process({
4504
- value: preprocessedContent,
4505
- path: filepath
4506
- });
4507
- const compileResult = String(vFile);
4508
- const compilationMeta = compiler.data('pageMeta');
4509
- const headingTitle = extractTextAndId(compilationMeta.title)[0];
4510
- pageMeta = {
4511
- ...compilationMeta,
4512
- title: frontmatterTitle || headingTitle,
4513
- headingTitle,
4514
- frontmatter
4515
- };
4516
- const result = `${compileResult}
4517
-
4518
- MDXContent.__RSPRESS_PAGE_META = {};
4519
- MDXContent.__RSPRESS_PAGE_META["${encodeURIComponent(normalizePath(node_path.relative(docDirectory, filepath)))}"] = ${JSON.stringify(pageMeta)};
4520
- `;
4521
- return result;
4522
- } catch (e) {
4523
- if (e instanceof Error) throw e;
4524
- throw new Error(`MDX compile error: ${e} in ${filepath}`);
4525
- }
4526
- }
4527
- const cache = new Map();
4528
- async function compileWithCrossCompilerCache(options) {
4529
- const filepath = options.filepath;
4530
- const task = cache.get(filepath);
4531
- if (task) {
4532
- cache.delete(filepath);
4533
- return task;
4534
- }
4535
- const promise = compile(options);
4536
- cache.set(filepath, promise);
4537
- return promise;
4538
- }
4539
- export { compile, compileWithCrossCompilerCache };