mdhtml 0.1.41__tar.gz → 0.1.43__tar.gz

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 (158) hide show
  1. {mdhtml-0.1.41 → mdhtml-0.1.43}/.github/workflows/ci.yml +2 -2
  2. {mdhtml-0.1.41 → mdhtml-0.1.43}/Cargo.lock +48 -52
  3. {mdhtml-0.1.41 → mdhtml-0.1.43}/Cargo.toml +6 -2
  4. {mdhtml-0.1.41 → mdhtml-0.1.43}/DEV.md +13 -11
  5. {mdhtml-0.1.41 → mdhtml-0.1.43}/PKG-INFO +57 -34
  6. {mdhtml-0.1.41 → mdhtml-0.1.43}/README.md +55 -33
  7. {mdhtml-0.1.41 → mdhtml-0.1.43}/docs/DIALECT.md +24 -22
  8. {mdhtml-0.1.41 → mdhtml-0.1.43}/docs/sample.html +38 -72
  9. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/README.md +1 -1
  10. mdhtml-0.1.43/examples/legal_demo-bound.docx +0 -0
  11. mdhtml-0.1.43/examples/legal_demo-form.docx +0 -0
  12. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo-render.md +40 -19
  13. mdhtml-0.1.43/examples/legal_demo.docx +0 -0
  14. mdhtml-0.1.43/examples/legal_demo.html +52 -0
  15. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo.ipynb +2 -2
  16. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo.md +1 -1
  17. mdhtml-0.1.43/examples/legal_demo.pdf +837 -1
  18. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo.typ +12 -11
  19. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/render_demo.py +4 -4
  20. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample-clean.md +7 -1
  21. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample-render.md +14 -2
  22. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample.md +7 -1
  23. {mdhtml-0.1.41 → mdhtml-0.1.43}/py/Cargo.toml +3 -3
  24. mdhtml-0.1.43/py/src/lib.rs +830 -0
  25. {mdhtml-0.1.41 → mdhtml-0.1.43}/pyproject.toml +1 -1
  26. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/__init__.py +35 -22
  27. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/chunk.py +3 -4
  28. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/export.py +15 -43
  29. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/fill.py +13 -8
  30. mdhtml-0.1.43/python/mdhtml/md.py +84 -0
  31. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/md2html.py +1 -1
  32. mdhtml-0.1.43/python/mdhtml/mustache.py +29 -0
  33. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/readme.py +2 -1
  34. mdhtml-0.1.43/python/mdhtml/typst.py +251 -0
  35. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/viewmd.py +2 -2
  36. mdhtml-0.1.43/rustfmt.toml +1 -0
  37. mdhtml-0.1.43/src/ast.rs +303 -0
  38. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/attrs.rs +19 -59
  39. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/block.rs +310 -804
  40. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/chunk.rs +44 -75
  41. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/diagnostic.rs +2 -10
  42. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/entity.rs +4 -7
  43. mdhtml-0.1.43/src/export_html.rs +322 -0
  44. mdhtml-0.1.43/src/frontmatter.rs +99 -0
  45. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/highlight.rs +13 -34
  46. mdhtml-0.1.43/src/html.rs +124 -0
  47. mdhtml-0.1.43/src/import.rs +239 -0
  48. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/inline.rs +184 -276
  49. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/inline_spans.rs +11 -23
  50. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/lib.rs +15 -20
  51. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/line.rs +5 -25
  52. mdhtml-0.1.43/src/markdown.rs +103 -0
  53. mdhtml-0.1.43/src/render.rs +648 -0
  54. mdhtml-0.1.43/src/resolve.rs +550 -0
  55. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/scan.rs +5 -37
  56. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/template.rs +12 -24
  57. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/wikitext.rs +87 -143
  58. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/wrap.rs +18 -29
  59. mdhtml-0.1.43/src/write_md.rs +635 -0
  60. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/canonical.rs +42 -1
  61. mdhtml-0.1.43/tests/helpers.py +81 -0
  62. mdhtml-0.1.43/tests/resolve.rs +177 -0
  63. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/cmark-gfm/extensions.txt +2 -4
  64. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/cmark-gfm/spec.txt +37 -46
  65. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/mf.txt +7 -7
  66. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_chunk.py +0 -7
  67. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_conformance.py +1 -64
  68. mdhtml-0.1.43/tests/test_export.py +542 -0
  69. mdhtml-0.1.43/tests/test_fill.py +131 -0
  70. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_focused.py +16 -63
  71. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_python.py +121 -347
  72. mdhtml-0.1.43/tests/test_readme.py +24 -0
  73. mdhtml-0.1.43/tests/test_typst.py +112 -0
  74. mdhtml-0.1.43/tests/test_wrap.py +17 -0
  75. mdhtml-0.1.41/examples/legal_demo-bound.docx +0 -0
  76. mdhtml-0.1.41/examples/legal_demo-form.docx +0 -0
  77. mdhtml-0.1.41/examples/legal_demo.docx +0 -0
  78. mdhtml-0.1.41/examples/legal_demo.html +0 -42
  79. mdhtml-0.1.41/examples/legal_demo.pdf +0 -813
  80. mdhtml-0.1.41/py/src/lib.rs +0 -969
  81. mdhtml-0.1.41/python/mdhtml/md.py +0 -327
  82. mdhtml-0.1.41/python/mdhtml/mustache.py +0 -29
  83. mdhtml-0.1.41/python/mdhtml/typst.py +0 -354
  84. mdhtml-0.1.41/rustfmt.toml +0 -4
  85. mdhtml-0.1.41/src/ast.rs +0 -273
  86. mdhtml-0.1.41/src/export_html.rs +0 -580
  87. mdhtml-0.1.41/src/frontmatter.rs +0 -57
  88. mdhtml-0.1.41/src/markdown.rs +0 -722
  89. mdhtml-0.1.41/src/render.rs +0 -692
  90. mdhtml-0.1.41/src/resolve.rs +0 -400
  91. mdhtml-0.1.41/src/write_md.rs +0 -335
  92. mdhtml-0.1.41/tests/test_export.py +0 -615
  93. mdhtml-0.1.41/tests/test_fill.py +0 -222
  94. mdhtml-0.1.41/tests/test_readme.py +0 -52
  95. mdhtml-0.1.41/tests/test_typst.py +0 -136
  96. mdhtml-0.1.41/tests/test_wrap.py +0 -42
  97. {mdhtml-0.1.41 → mdhtml-0.1.43}/.cargo/config.toml +0 -0
  98. {mdhtml-0.1.41 → mdhtml-0.1.43}/.gitignore +0 -0
  99. {mdhtml-0.1.41 → mdhtml-0.1.43}/.nojekyll +0 -0
  100. {mdhtml-0.1.41 → mdhtml-0.1.43}/CHANGELOG.md +0 -0
  101. {mdhtml-0.1.41 → mdhtml-0.1.43}/LICENSE +0 -0
  102. {mdhtml-0.1.41 → mdhtml-0.1.43}/_config.yml +0 -0
  103. {mdhtml-0.1.41 → mdhtml-0.1.43}/_layouts/default.html +0 -0
  104. {mdhtml-0.1.41 → mdhtml-0.1.43}/docs/puppy.jpg +0 -0
  105. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/demo.md +0 -0
  106. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/examples.ipynb +0 -0
  107. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/filldemo.py +0 -0
  108. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo-filled.md +0 -0
  109. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/legal_demo-filled.pdf +0 -0
  110. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/nbsample.ipynb +0 -0
  111. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/puppy.jpg +0 -0
  112. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample.css +0 -0
  113. {mdhtml-0.1.41 → mdhtml-0.1.43}/examples/sample.js +0 -0
  114. {mdhtml-0.1.41 → mdhtml-0.1.43}/py/build.rs +0 -0
  115. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/__main__.py +0 -0
  116. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/_cli.py +0 -0
  117. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/controls.html +0 -0
  118. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/page.css +0 -0
  119. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/tools.py +0 -0
  120. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/view.css +0 -0
  121. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/view.js +0 -0
  122. {mdhtml-0.1.41 → mdhtml-0.1.43}/python/mdhtml/wrap.py +0 -0
  123. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/preview.css +0 -0
  124. {mdhtml-0.1.41 → mdhtml-0.1.43}/src/tmpl.css +0 -0
  125. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/fixtures/dialect.html +0 -0
  126. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/fixtures/dialect.md +0 -0
  127. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/cmark-gfm/README.md +0 -0
  128. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/kramdown.txt +0 -0
  129. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/markdowntests.md +0 -0
  130. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/pandoc-grid-tables.txt +0 -0
  131. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Abbr.text +0 -0
  132. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Abbr.xhtml +0 -0
  133. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.text +0 -0
  134. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks Special Cases.xhtml +0 -0
  135. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.text +0 -0
  136. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Backtick Fenced Code Blocks.xhtml +0 -0
  137. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Definition Lists.text +0 -0
  138. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Definition Lists.xhtml +0 -0
  139. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Emphasis.text +0 -0
  140. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Emphasis.xhtml +0 -0
  141. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Footnotes.text +0 -0
  142. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Footnotes.xhtml +0 -0
  143. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Headers with attributes.text +0 -0
  144. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Headers with attributes.xhtml +0 -0
  145. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.text +0 -0
  146. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Inline HTML with Markdown content.xhtml +0 -0
  147. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.text +0 -0
  148. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Link & Image Attributes.xhtml +0 -0
  149. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tables.text +0 -0
  150. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tables.xhtml +0 -0
  151. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.text +0 -0
  152. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks Special Cases.xhtml +0 -0
  153. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.text +0 -0
  154. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/source/php-markdown-extra.mdtest/Tilde Fenced Code Blocks.xhtml +0 -0
  155. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/test_pathological.py +0 -0
  156. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/wasm.mjs +0 -0
  157. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/wikitext.rs +0 -0
  158. {mdhtml-0.1.41 → mdhtml-0.1.43}/tests/wrap.rs +0 -0
@@ -42,7 +42,7 @@ jobs:
42
42
  if: startsWith(github.ref, 'refs/tags/v')
43
43
  strategy:
44
44
  matrix:
45
- os: [ubuntu-latest, macos-latest]
45
+ os: [ubuntu-latest, ubuntu-24.04-arm, macos-latest]
46
46
  runs-on: ${{ matrix.os }}
47
47
  steps:
48
48
  - uses: actions/checkout@v7
@@ -102,7 +102,7 @@ jobs:
102
102
  - uses: dtolnay/rust-toolchain@stable
103
103
  - uses: rust-lang/crates-io-auth-action@v1
104
104
  id: auth
105
- - run: cargo publish -p mdhtml-crate
105
+ - run: cargo publish -p mdhtml-crate --no-verify
106
106
  env:
107
107
  CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }}
108
108
 
@@ -28,9 +28,9 @@ checksum = "4e7648175b45a9a48536d676f68d918270699102aa8dab5496df06904c914600"
28
28
 
29
29
  [[package]]
30
30
  name = "equivalent"
31
- version = "1.0.2"
31
+ version = "1.0.3"
32
32
  source = "registry+https://github.com/rust-lang/crates.io-index"
33
- checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f"
33
+ checksum = "00d174d5400e5e8fd687ad1049e2f578285fa914201b1af7e8b112a4546bd826"
34
34
 
35
35
  [[package]]
36
36
  name = "fast5ever"
@@ -47,6 +47,12 @@ version = "2.5.0"
47
47
  source = "registry+https://github.com/rust-lang/crates.io-index"
48
48
  checksum = "da7c62ceae207dd37ea5b845da6a0696c799f85e97da1ab5b7910be3c1c80223"
49
49
 
50
+ [[package]]
51
+ name = "foldhash"
52
+ version = "0.2.0"
53
+ source = "registry+https://github.com/rust-lang/crates.io-index"
54
+ checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb"
55
+
50
56
  [[package]]
51
57
  name = "hashbrown"
52
58
  version = "0.17.1"
@@ -61,9 +67,9 @@ checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea"
61
67
 
62
68
  [[package]]
63
69
  name = "html-escape"
64
- version = "0.2.15"
70
+ version = "0.3.0"
65
71
  source = "registry+https://github.com/rust-lang/crates.io-index"
66
- checksum = "c9356095b4b41197bba32173600e1582792cda618f65d12f68e2e77d273413c5"
72
+ checksum = "491194d601b4fa9fac3c9571e014070a0ad1bc3392d1bc10419695196a8b3cc3"
67
73
 
68
74
  [[package]]
69
75
  name = "html5ever"
@@ -93,9 +99,9 @@ checksum = "8f42a60cbdf9a97f5d2305f08a87dc4e09308d1276d28c869c684d7777685682"
93
99
 
94
100
  [[package]]
95
101
  name = "libc"
96
- version = "0.2.190"
102
+ version = "0.2.191"
97
103
  source = "registry+https://github.com/rust-lang/crates.io-index"
98
- checksum = "ce5d3ddc6d3fa000eb1536d85e147bfe31aacaba692ed6a876f95cb7c855be78"
104
+ checksum = "65cd87c9a6d60536580b316ad985726104730a5151c99845f2490428ef91240a"
99
105
 
100
106
  [[package]]
101
107
  name = "lock_api"
@@ -125,7 +131,7 @@ dependencies = [
125
131
 
126
132
  [[package]]
127
133
  name = "mdhtml-crate"
128
- version = "0.1.41"
134
+ version = "0.1.43"
129
135
  dependencies = [
130
136
  "base64",
131
137
  "fast5ever",
@@ -135,7 +141,7 @@ dependencies = [
135
141
 
136
142
  [[package]]
137
143
  name = "mdhtml-py"
138
- version = "0.1.41"
144
+ version = "0.1.43"
139
145
  dependencies = [
140
146
  "mdhtml-crate",
141
147
  "pyo3",
@@ -144,7 +150,7 @@ dependencies = [
144
150
 
145
151
  [[package]]
146
152
  name = "mdhtml-wasm"
147
- version = "0.1.41"
153
+ version = "0.1.43"
148
154
  dependencies = [
149
155
  "mdhtml-crate",
150
156
  ]
@@ -252,9 +258,9 @@ dependencies = [
252
258
 
253
259
  [[package]]
254
260
  name = "pyo3"
255
- version = "0.29.3"
261
+ version = "0.30.1"
256
262
  source = "registry+https://github.com/rust-lang/crates.io-index"
257
- checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655"
263
+ checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4"
258
264
  dependencies = [
259
265
  "libc",
260
266
  "once_cell",
@@ -266,18 +272,18 @@ dependencies = [
266
272
 
267
273
  [[package]]
268
274
  name = "pyo3-build-config"
269
- version = "0.29.3"
275
+ version = "0.30.1"
270
276
  source = "registry+https://github.com/rust-lang/crates.io-index"
271
- checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb"
277
+ checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700"
272
278
  dependencies = [
273
279
  "target-lexicon",
274
280
  ]
275
281
 
276
282
  [[package]]
277
283
  name = "pyo3-ffi"
278
- version = "0.29.3"
284
+ version = "0.30.1"
279
285
  source = "registry+https://github.com/rust-lang/crates.io-index"
280
- checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330"
286
+ checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4"
281
287
  dependencies = [
282
288
  "libc",
283
289
  "pyo3-build-config",
@@ -285,26 +291,26 @@ dependencies = [
285
291
 
286
292
  [[package]]
287
293
  name = "pyo3-macros"
288
- version = "0.29.3"
294
+ version = "0.30.1"
289
295
  source = "registry+https://github.com/rust-lang/crates.io-index"
290
- checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6"
296
+ checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60"
291
297
  dependencies = [
292
298
  "proc-macro2",
293
299
  "pyo3-macros-backend",
294
300
  "quote",
295
- "syn 2.0.119",
301
+ "syn",
296
302
  ]
297
303
 
298
304
  [[package]]
299
305
  name = "pyo3-macros-backend"
300
- version = "0.29.3"
306
+ version = "0.30.1"
301
307
  source = "registry+https://github.com/rust-lang/crates.io-index"
302
- checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3"
308
+ checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b"
303
309
  dependencies = [
304
310
  "heck",
305
311
  "proc-macro2",
306
312
  "quote",
307
- "syn 2.0.119",
313
+ "syn",
308
314
  ]
309
315
 
310
316
  [[package]]
@@ -357,15 +363,16 @@ checksum = "e7a5d71263a5a7d47b41f6b3f06ba276f10cc18b0931f1799f710578e2309348"
357
363
  dependencies = [
358
364
  "proc-macro2",
359
365
  "quote",
360
- "syn 3.0.6",
366
+ "syn",
361
367
  ]
362
368
 
363
369
  [[package]]
364
370
  name = "serde_json"
365
- version = "1.0.151"
371
+ version = "1.0.154"
366
372
  source = "registry+https://github.com/rust-lang/crates.io-index"
367
- checksum = "c841b55ecdae098c80dcae9cf767f6f8a0c2cdb3416bbef72181df4d0fe73f14"
373
+ checksum = "e7e9cc8b1b85264074fbcc02a88680c4096b1e47df8f739dceb03bf482f04bd6"
368
374
  dependencies = [
375
+ "foldhash",
369
376
  "indexmap",
370
377
  "itoa",
371
378
  "memchr",
@@ -376,9 +383,9 @@ dependencies = [
376
383
 
377
384
  [[package]]
378
385
  name = "serde_spanned"
379
- version = "1.1.1"
386
+ version = "1.1.2"
380
387
  source = "registry+https://github.com/rust-lang/crates.io-index"
381
- checksum = "6662b5879511e06e8999a8a235d848113e942c9124f211511b16466ee2995f26"
388
+ checksum = "4e7523beb55eece201a2356bee0bbca0d1ab466c14c07703b2e0ee6d42cb0c2c"
382
389
  dependencies = [
383
390
  "serde_core",
384
391
  ]
@@ -391,9 +398,9 @@ checksum = "33f4fe9184a62d842c9ef383018f3306d8ba224fd9d836f56d7288308847c256"
391
398
 
392
399
  [[package]]
393
400
  name = "smallvec"
394
- version = "1.16.2"
401
+ version = "1.16.4"
395
402
  source = "registry+https://github.com/rust-lang/crates.io-index"
396
- checksum = "f9395f0f0eee849a9b707b2f06bb92a6a422090e2123bb2ef8e87a0e61892a8e"
403
+ checksum = "d0d5d4b1981b8bbbb7aed204cae5726d683d5d6ac7e74ec54122ea28f315e7c8"
397
404
 
398
405
  [[package]]
399
406
  name = "string_cache"
@@ -421,20 +428,9 @@ dependencies = [
421
428
 
422
429
  [[package]]
423
430
  name = "syn"
424
- version = "2.0.119"
425
- source = "registry+https://github.com/rust-lang/crates.io-index"
426
- checksum = "872831b642d1a07999a962a351ed35b955ea2cfc8f3862091e2a240a84f17297"
427
- dependencies = [
428
- "proc-macro2",
429
- "quote",
430
- "unicode-ident",
431
- ]
432
-
433
- [[package]]
434
- name = "syn"
435
- version = "3.0.6"
431
+ version = "3.0.9"
436
432
  source = "registry+https://github.com/rust-lang/crates.io-index"
437
- checksum = "8593e8e72159ed2257d083c7a454a85cbf854f37a0966d8d483aff8c8a3ebcee"
433
+ checksum = "d78c8dee4c7bf0e14673097256fed6142ce9d3b85a408189d07482442145823b"
438
434
  dependencies = [
439
435
  "proc-macro2",
440
436
  "quote",
@@ -458,9 +454,9 @@ dependencies = [
458
454
 
459
455
  [[package]]
460
456
  name = "toml"
461
- version = "1.1.6+spec-1.1.0"
457
+ version = "1.1.8+spec-1.1.0"
462
458
  source = "registry+https://github.com/rust-lang/crates.io-index"
463
- checksum = "920602543f0911ab71da12c50d59701da54c196d1a2bf5cb4b75667f137a406a"
459
+ checksum = "20489e00e4d8741d6be680764cc12e270655e375a20d1011e844a9c3379e678d"
464
460
  dependencies = [
465
461
  "indexmap",
466
462
  "serde_core",
@@ -473,33 +469,33 @@ dependencies = [
473
469
 
474
470
  [[package]]
475
471
  name = "toml_datetime"
476
- version = "1.1.1+spec-1.1.0"
472
+ version = "1.1.2+spec-1.1.0"
477
473
  source = "registry+https://github.com/rust-lang/crates.io-index"
478
- checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7"
474
+ checksum = "2b86d767906c6c42421dcba507eb9d203e779497710a47782a224bb871653053"
479
475
  dependencies = [
480
476
  "serde_core",
481
477
  ]
482
478
 
483
479
  [[package]]
484
480
  name = "toml_parser"
485
- version = "1.1.3+spec-1.1.0"
481
+ version = "1.1.5+spec-1.1.0"
486
482
  source = "registry+https://github.com/rust-lang/crates.io-index"
487
- checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56"
483
+ checksum = "baa693a8032d7e1cada7d0041e96126df243179ff061456783ac7f12bda4744c"
488
484
  dependencies = [
489
485
  "winnow",
490
486
  ]
491
487
 
492
488
  [[package]]
493
489
  name = "toml_writer"
494
- version = "1.1.2+spec-1.1.0"
490
+ version = "1.1.3+spec-1.1.0"
495
491
  source = "registry+https://github.com/rust-lang/crates.io-index"
496
- checksum = "7d56353a2a665ad0f41a421187180aab746c8c325620617ad883a99a1cbe66d2"
492
+ checksum = "06bdbd8cfc056b8d2e2e85f29b56a3bdbecb527cef81eb39e3e7b98af4652770"
497
493
 
498
494
  [[package]]
499
495
  name = "unicode-ident"
500
- version = "1.0.26"
496
+ version = "1.0.27"
501
497
  source = "registry+https://github.com/rust-lang/crates.io-index"
502
- checksum = "d245f478577f809a851594d02313b640fb437e0bb33866753cff937863096954"
498
+ checksum = "a2c754d6c33795a1c324727428e5a7dedb5b06195f9890bdbcba760d3e246563"
503
499
 
504
500
  [[package]]
505
501
  name = "unicode-properties"
@@ -533,7 +529,7 @@ checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81"
533
529
 
534
530
  [[package]]
535
531
  name = "xtask"
536
- version = "0.1.41"
532
+ version = "0.1.43"
537
533
  dependencies = [
538
534
  "anyhow",
539
535
  "serde_json",
@@ -2,7 +2,7 @@
2
2
  members = ["py"]
3
3
 
4
4
  [workspace.package]
5
- version = "0.1.41"
5
+ version = "0.1.43"
6
6
  edition = "2024"
7
7
  rust-version = "1.91"
8
8
  license = "Apache-2.0"
@@ -58,9 +58,13 @@ incremental = false
58
58
  inherits = "dist"
59
59
  opt-level = "z"
60
60
 
61
+ [features]
62
+ default = ["dom"]
63
+ dom = ["dep:fast5ever"]
64
+
61
65
  [dependencies]
62
66
  base64 = ">=0.23"
63
- fast5ever = ">=0.1.5"
67
+ fast5ever = { version = ">=0.1.5", optional = true }
64
68
  html-escape = ">=0.2"
65
69
  unicode-properties = ">=0.1"
66
70
 
@@ -22,7 +22,7 @@ The `release` profile is optimized and incremental for fast local iteration. CI
22
22
  ## Testing
23
23
 
24
24
  ```bash
25
- cargo fmt
25
+ cargo fastfmt
26
26
  cargo check --workspace
27
27
  cargo clippy --workspace --all-targets
28
28
  cargo clippy -p mdhtml-wasm --target wasm32-unknown-unknown
@@ -49,21 +49,23 @@ The repository is a Cargo workspace with one published crate and one binding cra
49
49
 
50
50
  `node --test tests/wasm.mjs` runs Node's built-in test runner against the package in `wasm/pkg/`, through `mdhtml.js`. It checks rendering and Unicode string transfer, including across memory growth. After Rust changes, run `cargo wasm` before the test, because the test doesn't rebuild.
51
51
 
52
- A binding crate can only reach the library's public surface, so anything a binding needs is exported from `src/lib.rs`. The Python glue needs six items beyond the documented API (`render_inlines`, `plain`, `code_block_open`, `CODE_BLOCK_CLOSE`, `trailing_attr_span`, `highlight_md`), exported by name so the modules that hold them stay private.
52
+ The Python binding uses public semantic model, encoder, writer and resolver APIs. Its dictionary projection is shared by Document inspection and encoder callbacks. Source-position inspection uses its separate trace serializers.
53
53
 
54
54
  ## Shared MDHTML core
55
55
 
56
- MDHTML is the normative cross-format IR. `Document` is its typed Rust construction model; attributes, structured diagnostics, UTF-8-safe lines, bounded scans, and semantic serializers live in this crate so additional source importers can reuse them directly. Source-specific syntax structures remain private and transient.
56
+ `Document` is the shared semantic model. Panels, references and operations have explicit types; table cells, definitions, Figure bodies and operation operands contain blocks. MDHTML is its browser-readable import/encoding boundary. Source drafts, scanner tokens and rewrite traces remain separate from the semantic model. Importers and exporters share the Rust interpretation of raw payloads, metadata, plain text and references.
57
57
 
58
- Public conversion names use `x2y`, with both representations explicit: `md2mdhtml`, `mdhtml2md`, `wiki2mdhtml`, `md2gfm`, `mdhtml2html`, `mdhtml2typst`, `mdhtml2pdf`, external `mdhtml2docx`, `md2dom`, and `mdhtml2dom`. Inspection and mutation APIs such as `blocks`, `rewrite`, and `fill_md` keep ordinary verbs.
58
+ Public conversion names use `x2y`, with both representations explicit: `md2mdhtml`, `mdhtml2md`, `wiki2mdhtml`, `md2gfm`, `mdhtml2gfm`, `mdhtml2html`, `mdhtml2typst`, `mdhtml2pdf`, external `mdhtml2docx`, `md2dom`, and `mdhtml2dom`. Operations within a representation, including `bake_mdhtml`, `blocks`, `rewrite`, and `fill_md`, keep ordinary verbs.
59
59
 
60
- Rust's `render_md` serializes a `Document` directly to deterministic `md`, while `mdhtml2md` parses an MDHTML string and applies the same dialect contract. Both are distinct from Python's `mdhtml.md2gfm`, which rewrites authored Markdown while retaining untouched bytes.
60
+ `src/write_md.rs` contains one Document-based md/GFM writer. `mdhtml2md` and `dom2md` import HTML then call it; they have no separate serializer. `resolve::bake_document` assigns numbers and static reference text for HTML/GFM. `ReferenceIndex::plan` supplies validation, target kinds, prefixes, grouping and variants to live-reference Typst/DOCX exporters without baking their references. Python retains an immutable native Document and projects values for format-specific emission.
61
+
62
+ `Document.frontmatter` retains the complete recognized fenced YAML. `Document::meta()` derives simple flat string pairs. Python's MDHTML result carries the same `frontmatter` and exposes a derived read-only `meta` mapping. Recognition and splitting live in `src/frontmatter.rs`; filling parses the selected payload with the existing string-preserving loader. Notebook metadata selection and merging remain notebook-specific.
61
63
 
62
64
  The wikitext importer is a lower-level scanner in `src/wikitext.rs`. It emits the shared `Document` model directly, using the same block and inline types as the `md` parser. Balanced multiline templates, references, math, links, and the common literal-HTML subset are recognized without a source-rewriting prepass. Expansion-dependent islands are explicit raw `wikitext` carriers. A wikitext table that cannot lower structurally instead becomes visible document text, so recognized children such as templates and links remain available to downstream cleanup. Template resolution and article-content policy belong to downstream importers such as `parse-wiki`, which clean the `Document` before serialization.
63
65
 
64
66
  `src/chunk.rs` contains the historical textual Wikipedia chunker plus two parsed-block alternatives: the same hierarchical passes over safe top-level boundaries, and a local score-guided greedy picker. Their PyO3 results record each chunk's true starting boundary. `python/mdhtml/chunk.py` contains the shared experimental scorer; it counts visible rendered words and reports boundary and length components independently.
65
67
 
66
- `document_chunk_ranges_structural` applies the hierarchical structural algorithm to an existing `Document` and returns UTF-8 ranges into its serialized `md` plus repeated heading prefixes. `document_chunks_structural` materializes those ranges; footnote definitions are omitted rather than copied into every chunk. `md_chunks_structural` is the standalone `md` convenience path and parses before applying the same packing passes.
68
+ `document_chunk_ranges_structural` returns `(md, chunks)` from an existing `Document`. The Markdown writer records top-level block ranges during serialization. Chunking uses those ranges without cloning or re-serializing blocks. `document_chunks_structural` materializes the ranges. Footnote definitions remain in `md` but outside chunk ranges. `md_chunks_structural` is the standalone source-text path.
67
69
 
68
70
  ## Docs
69
71
 
@@ -76,23 +78,23 @@ gen_docs()
76
78
 
77
79
  ## HTML tree
78
80
 
79
- Rust renders provisional markup and does no HTML parsing. `python/mdhtml/__init__.py` sends that markup through `mdhtml2dom`, backed by [fast5ever](https://github.com/AnswerDotAI/fast5ever) (html5ever with an arena DOM and Python bindings), so parsing, tree construction, and serialization are the WHATWG algorithms as one engine spells them. The README describes the public API and `docs/DIALECT.md` defines the resulting DOM contract.
81
+ The optional `dom` feature enables fast5ever-backed HTML import and finished-HTML postprocessing. `import::parse_md` normalizes md containing embedded HTML as one complete HTML5 body fragment before semantic import. `import::from_mdhtml` imports symbolic MDHTML; already numbered presentation output is not an interchange format. Final HTML encoding runs from the prepared Document, followed by DOM-only work such as highlighting, navigation ids, namespace prefixes and table layout. It does not reimport or resolve the document again. Rust's direct `parse`, wikitext import, source tools, reference baking and Markdown serializers work without `dom`. The browser binding uses this direct path and relies on the browser's HTML parser.
80
82
 
81
83
  Non-Markdown syntax highlighting is an optional Python-layer adapter rather than a Rust dependency. Python imports fastpylight lazily and passes its result through `HtmlExportOptions::hl_fn`; the base Rust crate therefore carries no fastpylight or tree-sitter code. Without the `hl` extra, `mdhtml2html` leaves those code blocks plain and reports a warning, while Markdown fences continue to use mdhtml's own highlighter.
82
84
 
83
- `ops()` is the semantic-operation view over that DOM. Its traversal follows both ordinary children and inert `template.content`, returning live fast5ever nodes so source-specific pipelines can detach or replace operations without adding mutation policy to mdhtml.
85
+ `ops()` searches a mutable MDHTML DOM, including inert `template.content`. It returns live fast5ever nodes for source-specific cleanup. Exporters consume semantic Document values instead; `ops()` does not define their traversal or mutation policy.
84
86
 
85
87
  ## Render callbacks
86
88
 
87
- Callbacks transform children before their enclosing block. Image alt inlines are plain attribute data and are not traversed by inline callbacks. An implicit `Figure` stores a caption copied from the image alt, so caption callbacks run once and image replacement cannot erase Figure semantics. Before transforming the image, the Python bridge snapshots the Figure's source metadata; after transforming it, the bridge adds its standalone `content_html` and rendered `caption_html` before invoking the Figure callback.
89
+ `Document.mdhtml(callbacks=...)` uses the Rust encoder's child-first hook. Python receives the same semantic dictionaries as `Document.blocks`, plus the default rendered HTML. Returning None keeps the default; replacement HTML replaces that node. Operation operands are inert and are not traversed by callbacks. Image alt is plain text; Figure body and caption are independent structured fields. The bridge does not construct or transform a second tree, or add Figure snapshot fields.
88
90
 
89
91
  ## Template tokens
90
92
 
91
- Configured template tokens are recognized by `src/template.rs`. The block parser isolates whole-line `auto` and `block` tokens before inline parsing; the inline scanner handles `auto` and `inline` tokens elsewhere. Both become transient `TemplateToken` nodes and render as semantic `<template data-op="syntax:operation">operand</template>` carriers. Python validates the public `TemplateDelimiter` objects and passes compact tuples to the native extension.
93
+ Configured delimiters are recognized by `src/template.rs`. The block parser isolates whole-line `auto` and `block` tokens; the inline scanner handles `auto` and `inline` tokens elsewhere. Source traces retain delimiter spelling and offsets. The semantic model contains `Operation { syntax, action, name, args, content }`, with inert block-capable operands and an optional selected operand index. MDHTML encodes operations as `template[data-op][data-name]` elements. Python validates `TemplateDelimiter` objects and passes compact tuples to the scanner.
92
94
 
93
95
  ## Source rewriting
94
96
 
95
- `md2gfm` and template `tokens` find inline positions with `inlines`. During the block parse, `ContainerBuilder` records the line ranges of paragraphs, headings, and pipe tables, including those nested in containers. Opaque blocks such as code, raw HTML, block math, and grid tables produce no editable inline ranges. The inline source collector runs the inline parser over each of those ranges, using the content segments that `highlight_md` also scans (`LineMap` in `src/inline_spans.rs`), and maps each node back to source offsets. Raw HTML blocks contribute only their template tokens.
97
+ Source editing and template `tokens` find inline positions with `inlines`. During the block parse, `ContainerBuilder` records the line ranges of paragraphs, headings, and pipe tables, including those nested in containers. Opaque blocks such as code, raw HTML, and block math produce no editable inline ranges. The inline source collector runs the inline parser over each of those ranges, using the content segments that `highlight_md` also scans (`LineMap` in `src/inline_spans.rs`), and maps each node back to source offsets. Raw HTML blocks contribute only their template tokens. GFM export does not use these source-edit regions.
96
98
 
97
99
  `rewrite` accepts any block or inline type through the native `source_nodes` inventory. One block parse and its trace supply the nested blocks and inline collector, with uniform UTF-8 byte ranges; the PyO3 bridge reuses the inspection APIs' metadata serializers. Whole-line block ranges include container prefixes and the terminating newline. Template ownership comes from the parsed delimiter form: auto tokens belong to the inline collector, while explicit block-only tokens own opaque regions. No duplicate inventory needs reconciliation. Block and inline targets share the source-order replacement loop; replacing a parent suppresses its descendants. No replacement is reindented or serialized.
98
100