@lowlighter/markdown 2.0.0 → 3.0.1

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 (94) hide show
  1. package/README.md +31 -33
  2. package/mod.d.ts +34 -0
  3. package/mod.js +22 -0
  4. package/package.json +117 -40
  5. package/plugins/anchors.d.ts +11 -0
  6. package/plugins/anchors.js +39 -0
  7. package/plugins/callouts.d.ts +14 -0
  8. package/plugins/callouts.js +31 -0
  9. package/plugins/directives.d.ts +24 -0
  10. package/plugins/directives.js +76 -0
  11. package/plugins/emojis.d.ts +11 -0
  12. package/plugins/emojis.js +15 -0
  13. package/plugins/frontmatter.d.ts +20 -0
  14. package/plugins/frontmatter.js +49 -0
  15. package/plugins/gfm.d.ts +18 -0
  16. package/plugins/gfm.js +43 -0
  17. package/plugins/{highlighting.ts → highlighting.d.ts} +2 -11
  18. package/plugins/highlighting.js +24 -0
  19. package/plugins/markers.d.ts +15 -0
  20. package/plugins/markers.js +30 -0
  21. package/plugins/math.d.ts +21 -0
  22. package/plugins/math.js +75 -0
  23. package/plugins/mermaid.d.ts +25 -0
  24. package/plugins/mermaid.js +32 -0
  25. package/plugins/mod.d.ts +15 -0
  26. package/plugins/mod.js +14 -0
  27. package/plugins/{ruby.ts → ruby.d.ts} +2 -11
  28. package/plugins/ruby.js +28 -0
  29. package/plugins/uncomments.d.ts +13 -0
  30. package/plugins/uncomments.js +28 -0
  31. package/plugins/wikilinks.d.ts +26 -0
  32. package/plugins/wikilinks.js +45 -0
  33. package/presets/default.d.ts +3 -0
  34. package/presets/default.js +9 -0
  35. package/presets/svg.d.ts +3 -0
  36. package/presets/svg.js +11 -0
  37. package/presets/text.d.ts +3 -0
  38. package/presets/text.js +11 -0
  39. package/presets/web.d.ts +3 -0
  40. package/presets/web.js +12 -0
  41. package/renderer.d.ts +62 -0
  42. package/renderer.js +70 -0
  43. package/types.d.ts +85 -0
  44. package/types.js +10 -0
  45. package/deno.jsonc +0 -124
  46. package/deno.lock +0 -2282
  47. package/mod.mjs +0 -1
  48. package/mod.ts +0 -2
  49. package/mod_test.ts +0 -1
  50. package/plugins/anchors.mjs +0 -1
  51. package/plugins/anchors.ts +0 -21
  52. package/plugins/anchors_test.ts +0 -8
  53. package/plugins/directives.mjs +0 -1
  54. package/plugins/directives.ts +0 -112
  55. package/plugins/directives_test.ts +0 -13
  56. package/plugins/emojis.mjs +0 -1
  57. package/plugins/emojis.ts +0 -20
  58. package/plugins/emojis_test.ts +0 -8
  59. package/plugins/frontmatter.mjs +0 -1
  60. package/plugins/frontmatter.ts +0 -43
  61. package/plugins/frontmatter_test.ts +0 -18
  62. package/plugins/gfm.mjs +0 -1
  63. package/plugins/gfm.ts +0 -14
  64. package/plugins/gfm_test.ts +0 -28
  65. package/plugins/highlighting.mjs +0 -1
  66. package/plugins/highlighting_test.ts +0 -8
  67. package/plugins/linebreaks.mjs +0 -1
  68. package/plugins/linebreaks.ts +0 -21
  69. package/plugins/linebreaks_test.ts +0 -8
  70. package/plugins/markers.mjs +0 -1
  71. package/plugins/markers.ts +0 -25
  72. package/plugins/markers_test.ts +0 -13
  73. package/plugins/math.mjs +0 -1
  74. package/plugins/math.ts +0 -25
  75. package/plugins/math_test.ts +0 -8
  76. package/plugins/mermaid.mjs +0 -1
  77. package/plugins/mermaid.ts +0 -41
  78. package/plugins/mermaid_test.ts +0 -8
  79. package/plugins/mod.mjs +0 -1
  80. package/plugins/mod.ts +0 -14
  81. package/plugins/ruby.mjs +0 -1
  82. package/plugins/ruby_test.ts +0 -8
  83. package/plugins/sanitize.mjs +0 -1
  84. package/plugins/sanitize.ts +0 -26
  85. package/plugins/sanitize_test.ts +0 -15
  86. package/plugins/uncomments.mjs +0 -1
  87. package/plugins/uncomments.ts +0 -20
  88. package/plugins/uncomments_test.ts +0 -8
  89. package/plugins/wikilinks.mjs +0 -1
  90. package/plugins/wikilinks.ts +0 -40
  91. package/plugins/wikilinks_test.ts +0 -14
  92. package/renderer.mjs +0 -1
  93. package/renderer.ts +0 -138
  94. package/renderer_test.ts +0 -19
@@ -1,41 +0,0 @@
1
- // Imports
2
- import type { Plugin } from "../renderer.ts"
3
- import rehypeMermaid from "rehype-mermaid"
4
-
5
- /**
6
- * Add support for Mermaid diagrams.
7
- *
8
- * {@link https://mermaid-js.github.io/mermaid/ | See Mermaid documentation for more information}.
9
- *
10
- * > [!WARNING]
11
- * > This plugin requires playwright browser to be installed.
12
- * >
13
- * > You can install it by running the following command:
14
- * > ```sh
15
- * > npx playwright-core install --with-deps chromium
16
- * > ```
17
- *
18
- * > [!WARNING]
19
- * > This plugin requires the following permission in Deno:
20
- * > - read
21
- * > - env
22
- * > - sys
23
- * > - write: <TMP>
24
- * > - run: <location to playwright browser executable>
25
- *
26
- * @example
27
- * ````md
28
- * ```mermaid
29
- * graph TD;
30
- * A-->B;
31
- * A-->C;
32
- * B-->D;
33
- * C-->D;
34
- * ```
35
- * ````
36
- */
37
- export default {
38
- rehype(processor) {
39
- return processor.use(rehypeMermaid, { strategy: "inline-svg", launchOptions: { headless: true, args: ["--no-sandbox", "--disable-setuid-sandbox", "--disable-dev-shm-usage", "--disable-accelerated-2d-canvas", "--no-zygote", "--disable-gpu"] } })
40
- },
41
- } as Plugin
@@ -1,8 +0,0 @@
1
- import { expect, test } from "@libs/testing"
2
- import { Renderer } from "../renderer.ts"
3
- import plugin from "./mermaid.ts"
4
-
5
- test.skip("deno")("`Plugin.mermaid` renders mermaid diagrams", async () => {
6
- const markdown = new Renderer({ plugins: [plugin] })
7
- await expect(markdown.render("```mermaid\ngraph TD;\nA-->A;\n```")).resolves.toMatch(/foo<br>\nbar/)
8
- }, { permissions: { read: true, env: true, sys: true, write: "inherit", run: "inherit" } })