diff --git a/CHANGELOG.md b/CHANGELOG.md index 2d8f4f4..0a93e34 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,18 +7,22 @@ and this project adheres to [Semantic Versioning](https://semver.org/). ## [Unreleased] -### Fixed - -- Indented HTML (most real web pages) now keeps blank lines between blocks; previously - headings, paragraphs, lists and tables after the first ran together with a leading space - (`# A\n B` instead of `# A\n\nB`), which also broke headings and tables as markdown. - ### Changed - Design docs moved from `specs/` to an OKF v0.2 knowledge bundle in `knowledge/`, validated in CI. - CI workflows declare read-only default permissions and do not persist checkout credentials. - CI runs every example; `just bench` now runs the criterion benchmarks. - README, SECURITY and binding docs corrected: Python module is `markkit`, URL fetching has no private-network blocking yet. +- Dependencies: drop unused `async-trait`, `futures`, `regex`, `unicode-segmentation`, `encoding_rs`, + `base64`, `mime`, `lol_html` (core) and `tracing-subscriber`, plus unused deps of the CLI, bindings + and stub crates. Upgrade scraper 0.29, html5ever 0.40, quick-xml 0.42 (now a single version shared + with calamine), pyo3 0.30, criterion 0.8. The `logging` feature is reserved and enables only `tracing`. + +### Fixed + +- Indented HTML (most real web pages) now keeps blank lines between blocks; previously + headings, paragraphs, lists and tables after the first ran together with a leading space + (`# A\n B` instead of `# A\n\nB`), which also broke headings and tables as markdown. ## [0.1.1] - 2026-10-22 diff --git a/Cargo.lock b/Cargo.lock index c851243..01303b3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -12,10 +12,13 @@ dependencies = [ ] [[package]] -name = "allocator-api2" -version = "0.2.21" +name = "alloca" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" +checksum = "e5a7d05ea6aea7e9e64d25b9156ba2fee3fdd659e34e41063cd2fc7cd020d7f4" +dependencies = [ + "cc", +] [[package]] name = "anes" @@ -79,26 +82,6 @@ version = "1.0.104" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "330a5ed07fa54e4702c9d6c4174f74427fc0ef6e214bbd677ae50a5099946470" -[[package]] -name = "approx" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cab112f0a86d568ea0e627cc1d6be74a1e9cd55214684db5561995f6dad897c6" -dependencies = [ - "num-traits", -] - -[[package]] -name = "async-trait" -version = "0.1.92" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "82f6aeea286b8eb4dd3431a1be1b59d290ace00f5bfd8e2a159bc2a05e2c1667" -dependencies = [ - "proc-macro2", - "quote", - "syn 3.0.9", -] - [[package]] name = "atoi_simd" version = "0.18.1" @@ -144,12 +127,6 @@ dependencies = [ "pkg-config", ] -[[package]] -name = "base64" -version = "0.22.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" - [[package]] name = "base64" version = "0.23.1" @@ -211,18 +188,6 @@ version = "3.20.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "72f5acc6cb2ba439de613abc23857ec3d78374d8ed5ac84e9d11336e87da8649" -[[package]] -name = "bytecount" -version = "0.6.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "175812e0be2bccb6abe50bb8d566126198344f707e304f45c648fd8f2cc0365e" - -[[package]] -name = "bytemuck" -version = "1.25.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95832e849adfb21180ccb6826a99da14e5d266ae5c2e668e1602cf234f153797" - [[package]] name = "byteorder" version = "1.5.0" @@ -247,7 +212,7 @@ dependencies = [ "encoding_rs", "fast-float2", "log", - "quick-xml 0.42.0", + "quick-xml", "serde", "zip", ] @@ -301,7 +266,7 @@ checksum = "65c35e4b699c7e15ccbe7ee35c005e4fc0a278d22238a2857e6ce2dadeda1b06" dependencies = [ "cfg-if", "cpufeatures", - "rand_core 0.10.1", + "rand_core", ] [[package]] @@ -395,15 +360,6 @@ version = "1.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1d07550c9036bf2ae0c684c4297d503f838287c83c53686d05370d0e139ae570" -[[package]] -name = "colored" -version = "3.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "faf9468729b8cbcea668e36183cb69d317348c2e08e994829fb56ebfdfbaac34" -dependencies = [ - "windows-sys 0.61.2", -] - [[package]] name = "combine" version = "4.6.9" @@ -465,25 +421,24 @@ dependencies = [ [[package]] name = "criterion" -version = "0.5.1" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f2b12d017a929603d80db1831cd3a24082f8137ce19c69e6447f54f5fc8d692f" +checksum = "950046b2aa2492f9a536f5f4f9a3de7b9e2476e575e05bd6c333371add4d98f3" dependencies = [ + "alloca", "anes", "cast", "ciborium", "clap", "criterion-plot", - "is-terminal", "itertools", "num-traits", - "once_cell", "oorandom", + "page_size", "plotters", "rayon", "regex", "serde", - "serde_derive", "serde_json", "tinytemplate", "walkdir", @@ -491,9 +446,9 @@ dependencies = [ [[package]] name = "criterion-plot" -version = "0.5.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6b50826342786a51a89e2da3a28f1c32b06e387201bc2d19791f622c673706b1" +checksum = "d8d80a2f4f5b554395e47b5d8305bc3d27813bacb73493eb1001e8f76dae29ea" dependencies = [ "cast", "itertools", @@ -532,9 +487,9 @@ checksum = "460fbee9c2c2f33933d720630a6a0bac33ba7053db5344fac858d4b8952d77d5" [[package]] name = "cssparser" -version = "0.36.0" +version = "0.38.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dae61cf9c0abb83bd659dab65b7e4e38d8236824c85f0f804f173567bda257d2" +checksum = "11119743ad110e8c1bdccd930d7f5c30c99e5fc76a7b63ec9807e84eef0c5f59" dependencies = [ "cssparser-macros", "dtoa-short", @@ -545,12 +500,12 @@ dependencies = [ [[package]] name = "cssparser-macros" -version = "0.6.1" +version = "0.7.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13b588ba4ac1a99f7f2964d24b3d896ddc6bf847ee3855dbd4366f058cfcd331" +checksum = "d045de693cb712d0b22c6a64be5b953f67b3ce00ab5ad3dd5d8b441886ab8e1a" dependencies = [ "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -693,12 +648,6 @@ version = "1.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" -[[package]] -name = "foldhash" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77ce24cb58228fbb8aa041425bb1050850ac19177686ea6e0f41a70416f56fdb" - [[package]] name = "form_urlencoded" version = "1.2.2" @@ -834,7 +783,7 @@ dependencies = [ "js-sys", "libc", "r-efi", - "rand_core 0.10.1", + "rand_core", "wasm-bindgen", ] @@ -854,11 +803,6 @@ name = "hashbrown" version = "0.17.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" -dependencies = [ - "allocator-api2", - "equivalent", - "foldhash", -] [[package]] name = "heck" @@ -866,20 +810,15 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2304e00983f87ffb38b55b444b5e3b60a884b5d30c0fca7d82fe33449bbe55ea" -[[package]] -name = "hermit-abi" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e17592d60ebacc7d5e169f4663c5f84f9161cc90328abcfe8456f41e4dfcb284" - [[package]] name = "html5ever" -version = "0.39.0" +version = "0.40.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46a1761807faccc9a19e86944bbf40610014066306f96edcdedc2fb714bcb7b8" +checksum = "456a1a377e608e555d22ddab27ac0114bc7a7b4199078108e34c2aeae6c9b130" dependencies = [ "log", "markup5ever", + "memchr", ] [[package]] @@ -961,7 +900,7 @@ version = "0.1.21" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ddc03d96684f9226b8a787cdb71488417b53ab5ea8fdb1dac946cb9431cc8bff" dependencies = [ - "base64 0.23.1", + "base64", "bytes", "futures-channel", "futures-util", @@ -1093,32 +1032,12 @@ dependencies = [ "hashbrown", ] -[[package]] -name = "instant" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e0242819d153cba4b4b05a5a8f2a7e9bbf97b6055b2a002b395c96b5ff3c0222" -dependencies = [ - "cfg-if", -] - [[package]] name = "ipnet" version = "2.12.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "791930b43c0d5973160d90a8f3894509f2b273430f5c5c73b668636d0287c5c0" -[[package]] -name = "is-terminal" -version = "0.4.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3640c1c38b8e4e43584d8df18be5fc6b0aa314ce6ebf51b53313d4306cca8e46" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys 0.61.2", -] - [[package]] name = "is_terminal_polyfill" version = "1.70.2" @@ -1127,9 +1046,9 @@ checksum = "a6cb138bb79a146c1bd460005623e142ef0181e3d0219cb493e02f7d08a35695" [[package]] name = "itertools" -version = "0.10.5" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +checksum = "413ee7dfc52ee1a4949ceeb7dbc8a33f2d6c088194d9f922fb8318faf1f01186" dependencies = [ "either", ] @@ -1210,12 +1129,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "lazy_static" -version = "1.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "20870f649af7073d53e38067b2a84312175d56ea15217e1b15bc83506ec50afb" - [[package]] name = "libc" version = "0.2.191" @@ -1232,12 +1145,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "libm" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d2cec3eae94f9f509c767b45932f1ada8350c4bdb85af2fcab4a3c14807981" - [[package]] name = "linux-raw-sys" version = "0.12.1" @@ -1265,25 +1172,6 @@ version = "0.4.34" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f9f8bd3e56ce4dfc153cf470fffbfa98c7620958b312ca5c3a4b8d5181fd13c6" -[[package]] -name = "lol_html" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00aad58f6ec3990e795943872f13651e7a5fa59dca2c8f31a74faf8a0e0fb652" -dependencies = [ - "bitflags", - "cfg-if", - "cssparser", - "encoding_rs", - "foldhash", - "hashbrown", - "memchr", - "mime", - "precomputed-hash", - "selectors 0.37.0", - "thiserror", -] - [[package]] name = "lru-slab" version = "0.1.3" @@ -1295,19 +1183,12 @@ name = "markkit" version = "0.1.1" dependencies = [ "anyhow", - "async-trait", - "base64 0.22.1", "calamine", "cfb", "criterion", - "encoding_rs", - "futures", "html5ever", - "lol_html", - "mime", "proptest", - "quick-xml 0.41.0", - "regex", + "quick-xml", "reqwest", "scraper", "serde", @@ -1316,8 +1197,6 @@ dependencies = [ "thiserror", "tokio", "tracing", - "tracing-subscriber", - "unicode-segmentation", "zip", ] @@ -1327,14 +1206,6 @@ version = "0.1.1" dependencies = [ "anyhow", "clap", - "colored", - "instant", - "markkit", - "serde", - "serde_json", - "statrs", - "tabled", - "tokio", ] [[package]] @@ -1344,7 +1215,6 @@ dependencies = [ "anyhow", "clap", "markkit", - "serde", "serde_json", "tempfile", "tokio", @@ -1355,13 +1225,7 @@ name = "markkit-eval" version = "0.1.1" dependencies = [ "anyhow", - "async-trait", "clap", - "markkit", - "regex", - "reqwest", - "serde", - "serde_json", "tokio", ] @@ -1373,9 +1237,6 @@ dependencies = [ "napi", "napi-build", "napi-derive", - "serde", - "serde_json", - "tokio", ] [[package]] @@ -1385,52 +1246,25 @@ dependencies = [ "markkit", "pyo3", "pyo3-async-runtimes", - "serde_json", - "tokio", ] [[package]] name = "markup5ever" -version = "0.39.0" +version = "0.40.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7122d987ec5f704ee56f6e5b41a7d93722e9aae27ae07cafa4036c4d3f9757de" +checksum = "0ab3dc68ac4a0f5719e560136778c1ee716e296030d75dbd4484e37e39e3a842" dependencies = [ "log", "tendril", "web_atoms", ] -[[package]] -name = "matchers" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1525a2a28c7f4fa0fc98bb91ae755d1e2d1505079e05539e35bc876b5d65ae9" -dependencies = [ - "regex-automata", -] - -[[package]] -name = "matrixmultiply" -version = "0.3.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f607c237553f086e7043417a51df26b2eb899d3caff94e6a67592ff992fedc7" -dependencies = [ - "autocfg", - "rawpointer", -] - [[package]] name = "memchr" version = "2.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cf8baf1c55e62ffcace7a9f06f4bd9cd3f0c4beb022d3b367256b91b87513d98" -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - [[package]] name = "mio" version = "1.2.4" @@ -1448,23 +1282,6 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "743fb55ba31b18fb1ecef6bdc9aa2743314978ac084044301a7eee33fb99a20d" -[[package]] -name = "nalgebra" -version = "0.33.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d43ddcacf343185dfd6de2ee786d9e8b1c2301622afab66b6c73baf9882abfd" -dependencies = [ - "approx", - "matrixmultiply", - "num-complex", - "num-rational", - "num-traits", - "rand 0.8.8", - "rand_distr", - "simba", - "typenum", -] - [[package]] name = "napi" version = "3.15.0" @@ -1550,54 +1367,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2bf50223579dc7cdcfb3bfcacf7069ff68243f8c363f62ffa99cf000a6b9c451" -[[package]] -name = "nu-ansi-term" -version = "0.50.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7957b9740744892f114936ab4a57b3f487491bbeafaf8083688b16841a4240e5" -dependencies = [ - "windows-sys 0.61.2", -] - -[[package]] -name = "num-bigint" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c89e69e7e0f03bea5ef08013795c25018e101932225a656383bd384495ecc367" -dependencies = [ - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.47" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7ce2d95d4b3734dc35aa2f45e1aa22cd416814592a4f9d9205e11affd5b8e10b" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f83d14da390562dca69fc84082e73e548e1ad308d24accdedd2720017cb37824" -dependencies = [ - "num-bigint", - "num-integer", - "num-traits", -] - [[package]] name = "num-traits" version = "0.2.19" @@ -1605,7 +1374,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" dependencies = [ "autocfg", - "libm", ] [[package]] @@ -1633,14 +1401,13 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7c87def4c32ab89d880effc9e097653c8da5d6ef28e6b539d313baaacfbafcbe" [[package]] -name = "papergrid" -version = "0.18.0" +name = "page_size" +version = "0.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d0984e668274d34691bc2b262ef0d115de5fa9973bcdee7ae32213f93099153e" +checksum = "30d5b2194ed13191c1999ae0704b7839fb18384fa22e49b57eeaa97d79ce40da" dependencies = [ - "bytecount", - "fnv", - "unicode-width", + "libc", + "winapi", ] [[package]] @@ -1666,12 +1433,6 @@ dependencies = [ "windows-link", ] -[[package]] -name = "paste" -version = "1.0.15" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" - [[package]] name = "percent-encoding" version = "2.3.2" @@ -1680,9 +1441,9 @@ checksum = "9b4f627cb1b25917193a259e49bdad08f671f8d9708acfd5fe0a8c1455d87220" [[package]] name = "phf" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1562dc717473dbaa4c1f85a36410e03c047b2e7df7f45ee938fbef64ae7fadf" +checksum = "010378780309880b08997fae13be7834dba947d36393bd372f2b1556deb2a2f6" dependencies = [ "phf_macros", "phf_shared", @@ -1691,9 +1452,9 @@ dependencies = [ [[package]] name = "phf_codegen" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49aa7f9d80421bca176ca8dbfebe668cc7a2684708594ec9f3c0db0805d5d6e1" +checksum = "41b585a510fb76fdebead6897982ef2a03a21d8e6cbcca904999742a4afc6ffe" dependencies = [ "phf_generator", "phf_shared", @@ -1701,9 +1462,9 @@ dependencies = [ [[package]] name = "phf_generator" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "135ace3a761e564ec88c03a77317a7c6b80bb7f7135ef2544dbe054243b89737" +checksum = "aeb62e0959d5a1bebc965f4d15d9e2b7cea002b6b0f5ba8cde6cc26738467100" dependencies = [ "fastrand", "phf_shared", @@ -1711,9 +1472,9 @@ dependencies = [ [[package]] name = "phf_macros" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "812f032b54b1e759ccd5f8b6677695d5268c588701effba24601f6932f8269ef" +checksum = "5fa8d0ca26d424d27630da600c6624696e7dec8bf7b3b492b383c5dc49e5e085" dependencies = [ "phf_generator", "phf_shared", @@ -1724,9 +1485,9 @@ dependencies = [ [[package]] name = "phf_shared" -version = "0.13.1" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e57fef6bc5981e38c2ce2d63bfa546861309f875b8a75f092d1d54ae2d64f266" +checksum = "c6fd9027e2d9319be6349febd1db4e8d02aa544921200c9b777720ac34a3aa89" dependencies = [ "siphasher", ] @@ -1786,15 +1547,6 @@ dependencies = [ "zerovec", ] -[[package]] -name = "ppv-lite86" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" -dependencies = [ - "zerocopy", -] - [[package]] name = "precomputed-hash" version = "0.1.1" @@ -1831,7 +1583,7 @@ dependencies = [ "chacha20", "core_detect", "num-traits", - "rand 0.10.3", + "rand", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -1841,9 +1593,9 @@ dependencies = [ [[package]] name = "pyo3" -version = "0.29.3" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "700d18fa267b73b9b521fd7e13580e2f446916f176cacee1ab63fcc8191f1655" +checksum = "229ca13b8a15bb0d1487b81ab975bfcd97513416499a8312011b6036e42e0de4" dependencies = [ "libc", "once_cell", @@ -1855,9 +1607,9 @@ dependencies = [ [[package]] name = "pyo3-async-runtimes" -version = "0.29.0" +version = "0.30.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b3ef68daa7316a3fac65e5e18b2203f010346de1c1c53456811a2624673ab046" +checksum = "b877331c7817ccb6379e9d19a06993160141f1d0a386e55276128717df85e3fc" dependencies = [ "futures-channel", "futures-util", @@ -1869,18 +1621,18 @@ dependencies = [ [[package]] name = "pyo3-build-config" -version = "0.29.3" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b3fc0c4d08f6bb10e71fe39dfb9e2f59c6eb6854e22ec8092f50c69a4499adb" +checksum = "70130e2b6dd1ee589a8788026a429561ca5c40fa7a2fa7914c2282eddae24700" dependencies = [ "target-lexicon", ] [[package]] name = "pyo3-ffi" -version = "0.29.3" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dfc0b8e19df29aad7086cf977bb0c2a2f143e30567eb113e9cf72b62ca698330" +checksum = "5e7ff73c555c286d212d4ce7e5fbda845a973c4f61bd5f160f5f2c3c2a04d1c4" dependencies = [ "libc", "pyo3-build-config", @@ -1888,26 +1640,26 @@ dependencies = [ [[package]] name = "pyo3-macros" -version = "0.29.3" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6100e8a4b5eba53afaa5ed078364851a0b2499c553a44c31026b929049b49dc6" +checksum = "c46d2e5862c7bb8207e3b639f713dda3c499933444784154c11d013c5a691b60" dependencies = [ "proc-macro2", "pyo3-macros-backend", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] name = "pyo3-macros-backend" -version = "0.29.3" +version = "0.30.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6143877a16e82b5a727b7127ff4cd86858a24a28d745d72f43e6f227c7b1bdb3" +checksum = "38b89f066f2ae72a2aef52d1537ca2fcd104440ebfadee06e97aa90738a25b9b" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.119", + "syn 3.0.9", ] [[package]] @@ -1916,15 +1668,6 @@ version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" -[[package]] -name = "quick-xml" -version = "0.41.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e660451e55124f798a69a5af3f49ccfbefbd41910eefd25caf2393e1f3473ec1" -dependencies = [ - "memchr", -] - [[package]] name = "quick-xml" version = "0.42.0" @@ -1965,7 +1708,7 @@ dependencies = [ "bytes", "getrandom 0.4.3", "lru-slab", - "rand 0.10.3", + "rand", "rand_pcg", "ring", "rustc-hash", @@ -2007,17 +1750,6 @@ version = "6.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8dcc9c7d52a811697d2151c701e0d08956f92b0e24136cf4cf27b57a6a0d9bf" -[[package]] -name = "rand" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e058c7de0b26af77780c769414d6257830bb240f3c38477dbc2c16e5f54d6d4c" -dependencies = [ - "libc", - "rand_chacha", - "rand_core 0.6.4", -] - [[package]] name = "rand" version = "0.10.3" @@ -2026,26 +1758,7 @@ checksum = "65c9fb96cbc91e3478eaae79a69fcd3f1ae4ad052e471fe6732fff548984b4af" dependencies = [ "chacha20", "getrandom 0.4.3", - "rand_core 0.10.1", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core 0.6.4", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom 0.2.17", + "rand_core", ] [[package]] @@ -2054,23 +1767,13 @@ version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "63b8176103e19a2643978565ca18b50549f6101881c443590420e4dc998a3c69" -[[package]] -name = "rand_distr" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "32cb0b9bc82b0a0876c2dd994a7e7a2683d3e7390ca40e6886785ef0c7e3ee31" -dependencies = [ - "num-traits", - "rand 0.8.8", -] - [[package]] name = "rand_pcg" version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "caa0f4137e1c0a72f4c651489402276c8e8e1cf081f3b0ba156d2cbeef09e86a" dependencies = [ - "rand_core 0.10.1", + "rand_core", ] [[package]] @@ -2079,15 +1782,9 @@ version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "60aa6af80be32871323012e02e6e65f8a7cc7890931ae421d217ad8fe0df2ccf" dependencies = [ - "rand_core 0.10.1", + "rand_core", ] -[[package]] -name = "rawpointer" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" - [[package]] name = "rayon" version = "1.12.0" @@ -2152,7 +1849,7 @@ version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "16a1cfa75cc186dd73d5818e510e042e40927bccc9c236b061cea97e1eb08029" dependencies = [ - "base64 0.23.1", + "base64", "bytes", "futures-core", "http", @@ -2318,15 +2015,6 @@ dependencies = [ "wait-timeout", ] -[[package]] -name = "safe_arch" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96b02de82ddbe1b636e6170c21be622223aea188ef2e139be0a5b219ec215323" -dependencies = [ - "bytemuck", -] - [[package]] name = "same-file" version = "1.0.6" @@ -2353,17 +2041,16 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "scraper" -version = "0.26.0" +version = "0.29.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f5297102b8b62b4454ee8561601b2d551b4913148feb4241ca9d1a04bf4526" +checksum = "6844b5f49a5579f12ba4f89d9f7eec6d71889e4aa0bc7181821040ce66f08fff" dependencies = [ "cssparser", "ego-tree", "getopts", "html5ever", "precomputed-hash", - "selectors 0.36.1", - "tendril", + "selectors", ] [[package]] @@ -2391,36 +2078,15 @@ dependencies = [ [[package]] name = "selectors" -version = "0.36.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5d9c0c92a92d33f08817311cf3f2c29a3538a8240e94a6a3c622ce652d7e00c" -dependencies = [ - "bitflags", - "cssparser", - "derive_more", - "log", - "new_debug_unreachable", - "phf", - "phf_codegen", - "precomputed-hash", - "rustc-hash", - "servo_arc", - "smallvec", -] - -[[package]] -name = "selectors" -version = "0.37.0" +version = "0.41.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2cfaaa6035167f0e604e42723c7650d59ee269ef220d7bbe0565602c8a0173b9" +checksum = "8322aebea94a6cc288ff884e8a49bdbceef60206c400c6c46d22e62fc4fd91a6" dependencies = [ "bitflags", "cssparser", "derive_more", "log", "new_debug_unreachable", - "phf", - "phf_codegen", "precomputed-hash", "rustc-hash", "servo_arc", @@ -2478,41 +2144,19 @@ dependencies = [ [[package]] name = "servo_arc" -version = "0.4.3" +version = "0.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "170fb83ab34de17dc69aa7c67482b22218ddb85da56546f9bd6b929e32a05930" +checksum = "b4eceb519ec34d8290aaf6e46f435102f2bfa63f22b05a144fb16ab266d3b198" dependencies = [ "stable_deref_trait", ] -[[package]] -name = "sharded-slab" -version = "0.1.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f40ca3c46823713e0d4209592e8d6e826aa57e928f09752619fc696c499637f6" -dependencies = [ - "lazy_static", -] - [[package]] name = "shlex" version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f8fadd59c855ef2080decdef8ff161eb6661b86933c9d82e5ba29dc602a55aba" -[[package]] -name = "simba" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c99284beb21666094ba2b75bbceda012e610f5479dfcc2d6e2426f53197ffd95" -dependencies = [ - "approx", - "num-complex", - "num-traits", - "paste", - "wide", -] - [[package]] name = "simd-adler32" version = "0.3.10" @@ -2569,23 +2213,11 @@ version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6ce2be8dc25455e1f91df71bfa12ad37d7af1092ae736f3a6cd0e37bc7810596" -[[package]] -name = "statrs" -version = "0.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a3fe7c28c6512e766b0874335db33c94ad7b8f9054228ae1c2abd47ce7d335e" -dependencies = [ - "approx", - "nalgebra", - "num-traits", - "rand 0.8.8", -] - [[package]] name = "string_cache" -version = "0.9.0" +version = "0.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a18596f8c785a729f2819c0f6a7eae6ebeebdfffbfe4214ae6b087f690e31901" +checksum = "ffa8a5dbe8b3f0bbe29d4c3225daafaeead63afdc1b65fc4c01a1384166038e6" dependencies = [ "new_debug_unreachable", "parking_lot", @@ -2595,9 +2227,9 @@ dependencies = [ [[package]] name = "string_cache_codegen" -version = "0.6.1" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "585635e46db231059f76c5849798146164652513eb9e8ab2685939dd90f29b69" +checksum = "928dcdf75e47626b3617a976ec205d9f057584c371c1f23b782129268d0e6edc" dependencies = [ "phf_generator", "phf_shared", @@ -2659,29 +2291,6 @@ dependencies = [ "syn 3.0.9", ] -[[package]] -name = "tabled" -version = "0.22.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2d2596a104db1900b943f97d793a6c99addca918c4525c999f751a0f17d472eb" -dependencies = [ - "papergrid", - "tabled_derive", - "testing_table", -] - -[[package]] -name = "tabled_derive" -version = "0.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dca1937322a1e892b1a65f6a6736183bb0a29d3b4234d1d53bc436dff9beb76" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "syn 2.0.119", -] - [[package]] name = "target-lexicon" version = "0.13.5" @@ -2710,15 +2319,6 @@ dependencies = [ "new_debug_unreachable", ] -[[package]] -name = "testing_table" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0f8daae29995a24f65619e19d8d31dea5b389f3d853d8bf297bbf607cd0014cc" -dependencies = [ - "unicode-width", -] - [[package]] name = "thiserror" version = "2.0.21" @@ -2739,15 +2339,6 @@ dependencies = [ "syn 3.0.9", ] -[[package]] -name = "thread_local" -version = "1.1.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ad99c4c6d32803332c548b1af0540b357b3f5fc0be8f6c6bfe8b2e6ae784070" -dependencies = [ - "cfg-if", -] - [[package]] name = "tinystr" version = "0.8.5" @@ -2914,36 +2505,6 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db97caf9d906fbde555dd62fa95ddba9eecfd14cb388e4f491a66d74cd5fb79a" dependencies = [ "once_cell", - "valuable", -] - -[[package]] -name = "tracing-log" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ee855f1f400bd0e5c02d150ae5de3840039a3f54b025156404e34c23c03f47c3" -dependencies = [ - "log", - "once_cell", - "tracing-core", -] - -[[package]] -name = "tracing-subscriber" -version = "0.3.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7f578e5945fb242538965c2d0b04418d38ec25c79d160cd279bf0731c8d319" -dependencies = [ - "matchers", - "nu-ansi-term", - "once_cell", - "regex-automata", - "sharded-slab", - "smallvec", - "thread_local", - "tracing", - "tracing-core", - "tracing-log", ] [[package]] @@ -2958,12 +2519,6 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ce898823d8cd0f028662d2f349694b1af0a5cc9be83f1d213a00d3147445e1e" -[[package]] -name = "typenum" -version = "1.20.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" - [[package]] name = "unarray" version = "0.1.4" @@ -3028,12 +2583,6 @@ dependencies = [ "wasm-bindgen", ] -[[package]] -name = "valuable" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" - [[package]] name = "wait-timeout" version = "0.2.1" @@ -3146,9 +2695,9 @@ dependencies = [ [[package]] name = "web_atoms" -version = "0.2.6" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba8b815c1b593dc0baf78dd0f4fc8fdb2de53198fb1163738093e9a311c33fb3" +checksum = "7572660c8890448ba236b7376f27e389c6a7e1c70195622faced601f855c0ada" dependencies = [ "phf", "phf_codegen", @@ -3166,15 +2715,21 @@ dependencies = [ ] [[package]] -name = "wide" -version = "0.7.33" +name = "winapi" +version = "0.3.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce5da8ecb62bcd8ec8b7ea19f69a51275e91299be594ea5cc6ef7819e16cd03" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" dependencies = [ - "bytemuck", - "safe_arch", + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", ] +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + [[package]] name = "winapi-util" version = "0.1.11" @@ -3184,6 +2739,12 @@ dependencies = [ "windows-sys 0.61.2", ] +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + [[package]] name = "windows-link" version = "0.2.1" diff --git a/Cargo.toml b/Cargo.toml index fe4a37d..a67f998 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -24,8 +24,6 @@ categories = ["text-processing", "command-line-utilities", "parser-implementatio [workspace.dependencies] # Async tokio = { version = "1", default-features = false } -async-trait = "0.1" -futures = "0.3" # Error handling thiserror = "2" @@ -42,35 +40,21 @@ clap = { version = "4", features = ["derive"] } reqwest = { version = "0.13", default-features = false, features = ["rustls", "json"] } # HTML parsing -scraper = "0.26" -html5ever = "0.39" -lol_html = "2" - -# Text processing -regex = "1" -unicode-segmentation = "1" +scraper = "0.29" +html5ever = "0.40" # Document formats calamine = "0.37" # Excel/spreadsheet (XLSX/XLS/ODS) zip = { version = "9", default-features = false, features = ["deflate"] } # OOXML/ODF containers; matches calamine's zip -quick-xml = "0.41" # DOCX/ODS XML parsing +quick-xml = "0.42" # DOCX/ODS XML parsing cfb = "0.15" # XLS (OLE2) container pre-scan -# Image / OCR (optional) -image = "0.25" - -# Encoding -encoding_rs = "0.8" -base64 = "0.22" -mime = "0.3" - # Logging tracing = "0.1" -tracing-subscriber = { version = "0.3", features = ["env-filter"] } # Python bindings -pyo3 = { version = "0.29" } -pyo3-async-runtimes = { version = "0.29", features = ["tokio-runtime"] } +pyo3 = { version = "0.30" } +pyo3-async-runtimes = { version = "0.30", features = ["tokio-runtime"] } # Node.js bindings napi = { version = "3", features = ["async", "serde-json"] } @@ -78,7 +62,7 @@ napi-derive = "3" # Testing tempfile = "3" -criterion = { version = "0.5", features = ["html_reports"] } +criterion = { version = "0.8", features = ["html_reports"] } proptest = "1" [profile.release] diff --git a/NOTICE b/NOTICE index b0d3111..1854781 100644 --- a/NOTICE +++ b/NOTICE @@ -28,8 +28,7 @@ Markkit relies on several permissively licensed crates: * scraper (MIT) – HTML parsing and CSS selector matching * html5ever (MIT/Apache-2.0) – HTML5 parsing -* lol_html (BSD-3-Clause) – Low-latency HTML rewriting -* pdf-extract (MIT) – PDF text extraction +* zip (MIT), quick-xml (MIT), calamine (MIT), cfb (MIT) – Office document containers and XML * reqwest (MIT/Apache-2.0) – HTTP client * tokio (MIT) – Async runtime * serde / serde_json (MIT/Apache-2.0) – Serialization diff --git a/README.md b/README.md index dc343aa..4987e1b 100644 --- a/README.md +++ b/README.md @@ -155,7 +155,7 @@ let markkit = Markkit::builder() | `spreadsheet` | No | XLSX/XLSM, XLS, ODS conversion (calamine) | | `pdf` | No | Placeholder; PDF currently returns `UnsupportedFormat` | | `all_formats` | No | `html`, `pdf`, `docx`, `spreadsheet` | -| `logging` | No | Structured tracing output | +| `logging` | No | Reserved: pulls in `tracing`, emits no events yet | `http_client` is optional. Embedders that fetch content themselves can build without reqwest (no HTTP/TLS stack in the dependency tree): diff --git a/crates/markkit-bench/Cargo.toml b/crates/markkit-bench/Cargo.toml index f5d2f4a..45f7ed3 100644 --- a/crates/markkit-bench/Cargo.toml +++ b/crates/markkit-bench/Cargo.toml @@ -13,19 +13,5 @@ name = "markkit-bench" path = "src/main.rs" [dependencies] -markkit = { path = "../markkit", features = ["all_formats", "http_client"] } -tokio = { workspace = true, features = ["rt-multi-thread"] } -serde.workspace = true -serde_json.workspace = true clap.workspace = true anyhow.workspace = true - -# Timing -instant = "0.1" - -# Statistics -statrs = "0.18" - -# Terminal output -colored = "3" -tabled = "0.22" diff --git a/crates/markkit-cli/Cargo.toml b/crates/markkit-cli/Cargo.toml index 21cf10d..69495f0 100644 --- a/crates/markkit-cli/Cargo.toml +++ b/crates/markkit-cli/Cargo.toml @@ -30,7 +30,6 @@ markkit = { path = "../markkit", version = "0.1.1", features = ["http_client"] } tokio = { workspace = true, features = ["macros", "net", "rt", "rt-multi-thread", "time", "fs"] } clap.workspace = true anyhow.workspace = true -serde.workspace = true serde_json.workspace = true [dev-dependencies] diff --git a/crates/markkit-eval/Cargo.toml b/crates/markkit-eval/Cargo.toml index 9ae387e..c8d5062 100644 --- a/crates/markkit-eval/Cargo.toml +++ b/crates/markkit-eval/Cargo.toml @@ -14,12 +14,6 @@ name = "markkit-eval" path = "src/main.rs" [dependencies] -markkit = { path = "../markkit", features = ["all_formats", "http_client"] } tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -serde.workspace = true -serde_json.workspace = true clap.workspace = true anyhow.workspace = true -reqwest.workspace = true -regex.workspace = true -async-trait.workspace = true diff --git a/crates/markkit-js/Cargo.toml b/crates/markkit-js/Cargo.toml index fd26309..cf99468 100644 --- a/crates/markkit-js/Cargo.toml +++ b/crates/markkit-js/Cargo.toml @@ -17,9 +17,6 @@ doc = false markkit = { path = "../markkit", features = ["all_formats", "http_client"] } napi.workspace = true napi-derive.workspace = true -serde.workspace = true -serde_json.workspace = true -tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } [build-dependencies] napi-build = "2" diff --git a/crates/markkit-python/Cargo.toml b/crates/markkit-python/Cargo.toml index c0d6f49..1d7300e 100644 --- a/crates/markkit-python/Cargo.toml +++ b/crates/markkit-python/Cargo.toml @@ -18,5 +18,3 @@ doc = false markkit = { path = "../markkit", features = ["all_formats", "http_client"] } pyo3.workspace = true pyo3-async-runtimes.workspace = true -tokio = { workspace = true, features = ["rt-multi-thread", "macros"] } -serde_json.workspace = true diff --git a/crates/markkit/Cargo.toml b/crates/markkit/Cargo.toml index e21e445..c5fe350 100644 --- a/crates/markkit/Cargo.toml +++ b/crates/markkit/Cargo.toml @@ -15,42 +15,28 @@ readme = "../../README.md" [features] default = ["html", "http_client"] -html = ["dep:scraper", "dep:html5ever", "dep:lol_html"] +html = ["dep:scraper", "dep:html5ever"] pdf = [] docx = ["dep:zip", "dep:quick-xml"] spreadsheet = ["dep:calamine", "dep:zip", "dep:quick-xml", "dep:cfb"] http_client = ["dep:reqwest"] -logging = ["dep:tracing", "dep:tracing-subscriber"] +logging = ["dep:tracing"] all_formats = ["html", "pdf", "docx", "spreadsheet"] [dependencies] # Async tokio = { workspace = true, features = ["sync", "io-util"] } -async-trait.workspace = true -futures.workspace = true # Error handling thiserror.workspace = true -anyhow.workspace = true # Serialization serde.workspace = true serde_json.workspace = true -# Text processing -regex.workspace = true -unicode-segmentation.workspace = true - -# Encoding -encoding_rs.workspace = true -base64.workspace = true -mime.workspace = true - # HTML (optional) scraper = { workspace = true, optional = true } html5ever = { workspace = true, optional = true } -lol_html = { workspace = true, optional = true } - # Office documents (optional): DOCX + spreadsheets share the ZIP/XML stack zip = { workspace = true, optional = true } @@ -65,9 +51,9 @@ reqwest = { workspace = true, optional = true } # Logging (optional) tracing = { workspace = true, optional = true } -tracing-subscriber = { workspace = true, optional = true } [dev-dependencies] +anyhow.workspace = true tokio = { workspace = true, features = ["macros", "rt-multi-thread"] } tempfile.workspace = true proptest.workspace = true diff --git a/crates/markkit/src/spreadsheet.rs b/crates/markkit/src/spreadsheet.rs index c86b04b..2ca280c 100644 --- a/crates/markkit/src/spreadsheet.rs +++ b/crates/markkit/src/spreadsheet.rs @@ -550,15 +550,15 @@ fn scan_biff_sheet(sheet: &[u8]) -> Result { // ─── ODS pre-scan (row / column repeats) ──────────────────────────── -fn attr_u64(e: &BytesStart<'_>, local: &[u8]) -> Option { +fn attr_u64(e: &BytesStart<'_>, local: &str) -> Option { e.attributes().with_checks(false).flatten().find_map(|a| { (a.key.local_name().as_ref() == local) - .then(|| std::str::from_utf8(&a.value).ok()?.trim().parse().ok()) + .then(|| a.value.trim().parse().ok()) .flatten() }) } -fn has_attr(e: &BytesStart<'_>, local: &[u8]) -> bool { +fn has_attr(e: &BytesStart<'_>, local: &str) -> bool { e.attributes() .with_checks(false) .flatten() @@ -587,14 +587,14 @@ impl OdsTable { } fn start_row(&mut self, e: &BytesStart<'_>) { - let rep = attr_u64(e, b"number-rows-repeated").unwrap_or(1).max(1); + let rep = attr_u64(e, "number-rows-repeated").unwrap_or(1).max(1); self.row_repeat = rep.min(ODS_MAX_ROWS.saturating_sub(self.next_row)).max(1); self.col = 0; self.width = 0; } fn cell(&mut self, e: &BytesStart<'_>, non_empty: bool) { - let rep = attr_u64(e, b"number-columns-repeated").unwrap_or(1).max(1); + let rep = attr_u64(e, "number-columns-repeated").unwrap_or(1).max(1); self.col = self.col.saturating_add(rep).min(ODS_MAX_COLS); if non_empty { self.width = self.col; @@ -636,8 +636,8 @@ fn prescan_ods(content: &[u8], max_cells: u64) -> Result<(), Error> { Event::Start(ref e) | Event::Empty(ref e) => { let is_empty_el = matches!(ev, Event::Empty(_)); match e.local_name().as_ref() { - b"table" if !is_empty_el => table = Some(OdsTable::default()), - b"table-row" => { + "table" if !is_empty_el => table = Some(OdsTable::default()), + "table-row" => { if let Some(t) = table.as_mut() { t.start_row(e); if is_empty_el { @@ -645,9 +645,9 @@ fn prescan_ods(content: &[u8], max_cells: u64) -> Result<(), Error> { } } } - b"table-cell" | b"covered-table-cell" => { + "table-cell" | "covered-table-cell" => { if let Some(t) = table.as_mut() { - let non_empty = !is_empty_el || has_attr(e, b"value-type"); + let non_empty = !is_empty_el || has_attr(e, "value-type"); t.cell(e, non_empty); } } @@ -655,13 +655,13 @@ fn prescan_ods(content: &[u8], max_cells: u64) -> Result<(), Error> { } } Event::End(ref e) => match e.local_name().as_ref() { - b"table-row" => { + "table-row" => { if let Some(t) = table.as_mut() { t.end_row(); check(total.saturating_add(t.area()))?; } } - b"table" => { + "table" => { if let Some(t) = table.take() { total = total.saturating_add(t.area()); check(total)?; diff --git a/crates/markkit/src/xml.rs b/crates/markkit/src/xml.rs index f755cc4..a2881ba 100644 --- a/crates/markkit/src/xml.rs +++ b/crates/markkit/src/xml.rs @@ -7,7 +7,6 @@ //! billion-laughs / XXE payloads surface as unresolved references, which we drop. //! Tree depth is capped and the tree is built iteratively (no recursion on input). -use quick_xml::encoding::Decoder; use quick_xml::events::{BytesStart, Event}; use quick_xml::{Reader, XmlVersion}; @@ -92,21 +91,20 @@ impl Element { } } -fn local(name: &[u8]) -> String { - let local = match name.iter().rposition(|&b| b == b':') { - Some(i) => &name[i + 1..], - None => name, - }; - String::from_utf8_lossy(local).into_owned() +fn local(name: &str) -> String { + match name.rsplit_once(':') { + Some((_, local)) => local.to_string(), + None => name.to_string(), + } } -fn element_from(start: &BytesStart<'_>, decoder: Decoder) -> Element { +fn element_from(start: &BytesStart<'_>) -> Element { let mut attrs = Vec::new(); for attr in start.attributes().with_checks(false).flatten() { let key = local(attr.key.as_ref()); - let value = match attr.decoded_and_normalized_value(XmlVersion::Implicit1_0, decoder) { + let value = match attr.normalized_value(XmlVersion::Implicit1_0) { Ok(v) => v.into_owned(), - Err(_) => String::from_utf8_lossy(&attr.value).into_owned(), + Err(_) => attr.value.into_owned(), }; attrs.push((key, value)); } @@ -146,10 +144,10 @@ pub(crate) fn parse(bytes: &[u8]) -> Result { "XML nesting deeper than {MAX_XML_DEPTH}" ))); } - stack.push(element_from(&s, reader.decoder())); + stack.push(element_from(&s)); } Event::Empty(s) => { - let el = element_from(&s, reader.decoder()); + let el = element_from(&s); if let Some(top) = stack.last_mut() { top.children.push(XNode::Element(el)); } @@ -163,25 +161,21 @@ pub(crate) fn parse(bytes: &[u8]) -> Result { } } Event::Text(t) => { - let text = t - .xml_content(XmlVersion::Implicit1_0) - .map_err(|e| XmlError::Invalid(format!("bad text encoding: {e}")))?; + let text = t.xml_content(XmlVersion::Implicit1_0); if let Some(top) = stack.last_mut() { push_text(top, &text); } } Event::CData(t) => { - let text = String::from_utf8_lossy(&t); if let Some(top) = stack.last_mut() { - push_text(top, &text); + push_text(top, &t); } } Event::GeneralRef(r) => { let resolved: Option = match r.resolve_char_ref() { Ok(Some(c)) => Some(c.to_string()), Ok(None) => { - let name = String::from_utf8_lossy(&r); - quick_xml::escape::resolve_predefined_entity(&name).map(str::to_string) + quick_xml::escape::resolve_predefined_entity(&r).map(str::to_string) } Err(_) => None, }; diff --git a/deny.toml b/deny.toml index eed71ab..b4f7594 100644 --- a/deny.toml +++ b/deny.toml @@ -1,21 +1,14 @@ [advisories] -ignore = [ - { id = "RUSTSEC-2024-0436", reason = "paste is a transitive dep of statrs/nalgebra, no security impact" }, - { id = "RUSTSEC-2024-0384", reason = "instant is a transitive dep of markkit-bench, no security impact" }, -] +ignore = [] [licenses] allow = [ "MIT", "Apache-2.0", - "BSD-2-Clause", "BSD-3-Clause", "ISC", "Unicode-3.0", - "Unicode-DFS-2016", "Zlib", - "OpenSSL", - "BSL-1.0", "MPL-2.0", "CDLA-Permissive-2.0", "Apache-2.0 WITH LLVM-exception", diff --git a/knowledge/log.md b/knowledge/log.md index 8701f9f..1cb075e 100644 --- a/knowledge/log.md +++ b/knowledge/log.md @@ -2,6 +2,7 @@ ## 2026-10-26 +* **Dependency trim**: unused dependencies removed (lockfile shrinks by ~460 lines; the `instant`/`paste` unmaintained advisories and their `deny.toml` ignores are gone with the stub bench deps). quick-xml moves to 0.42, one version shared with calamine; markkit's XML walkers now read `&str` names and values. See [Threat Model](security/threat-model.md) T6d and [Maintenance](operations/maintenance.md). * **Inter-block whitespace**: indented HTML lost blank lines between blocks and leaked a leading space into every following line, because whitespace-only text between blocks stayed in the block list as `Text(" ")`. The parser now normalizes block-context lists; golden fixtures, which had recorded the broken output, are regenerated. See [HTML Extraction](formats/html-extraction.md) and [IR Specification](foundations/ir.md). * **OKF migration**: `specs/` became this OKF v0.2 bundle, grouped into `foundations/`, `formats/`, `security/`, `runtimes/`, `operations/`. Every concept gained frontmatter and a See also section; `just check-okf` and CI enforce conformance. See [Knowledge Maintenance Contract](knowledge-contract.md). * **Accuracy pass**: [Python Package](runtimes/python-package.md) now names the shipped `markkit` module; [Examples](operations/examples.md) lists the four real examples; [Evaluation Harness](operations/eval.md) is marked as a stub; [Threat Model](security/threat-model.md) T3 records that `http_client` is a default feature and SSRF mitigations are still open. diff --git a/knowledge/operations/maintenance.md b/knowledge/operations/maintenance.md index 9b21de8..e975a47 100644 --- a/knowledge/operations/maintenance.md +++ b/knowledge/operations/maintenance.md @@ -132,6 +132,10 @@ Findings shipped as separate PRs in the same pass: unused dependencies (core `async-trait`, `futures`, `regex`, `unicode-segmentation`, `encoding_rs`, `base64`, `mime`, `lol_html`; most stub-crate deps) and pending major upgrades; indented HTML losing paragraph breaks between blocks (smoke test of `examples/basic.rs`). +Dependency PR: 18 unused deps removed, quick-xml/scraper/html5ever/pyo3/criterion +majors applied, `deny.toml` ignores and unused license allowances dropped; +`cargo audit` reports nothing, `cargo deny` one duplicate (`syn` 1/2, proc-macro +ecosystem split). ## See also diff --git a/knowledge/security/threat-model.md b/knowledge/security/threat-model.md index 5c0bb00..9d906ac 100644 --- a/knowledge/security/threat-model.md +++ b/knowledge/security/threat-model.md @@ -168,7 +168,7 @@ process, or smuggling content past a human reviewer. #### T6d: XML entity attacks (billion laughs, XXE) - quick-xml never expands DTD-declared or external entities; such references are dropped. Only the five predefined entities and character references are resolved. -- quick-xml >= 0.41 (via calamine 0.36) fixes RUSTSEC-2026-0194 (quadratic duplicate-attribute +- quick-xml 0.42 (one version shared with calamine 0.37) includes the RUSTSEC-2026-0194 fix (quadratic duplicate-attribute check); markkit's own XML walkers iterate attributes with `with_checks(false)` and never use `NsReader` (RUSTSEC-2026-0195).