Repository navigation
Release v0.2.0
Fixed
-
Prevent raw HTML escaping code blocks inside task lists and nested definitions.
Task bodies now start below their checkbox; definitions render as GFM lists
below each term, preserving code blocks without requiring a definition-list extension.
Nested lists beginning with an empty item are separated from preceding text. Hard
breaks inside headings and link labels are flattened so they cannot close the
container before later inline code. Redundant nested bold, italic and
strikethrough wrappers no longer emit delimiters that close their outer span,
and adjacent bracketed nodes cannot combine with following text into a link. -
PDF stream guards honor escaped dictionary keys and bound compressed prefixes
before image filters, including when OCR is disabled. -
Footnote bodies cannot become unsafe reference-link destinations in Markdown readers
without footnote support. Bodies start after a blank line and remain valid footnotes
in readers that support them (nightly renderer fuzz regression).
Added
-
Optional Rust OCR backend (
pdf-ocr-ocrs) using ocrs/RTen and explicit local
ONNX model paths. CLI--ocr-backend ocrs, NodepdfOcrBackend, and Python
pdf_ocr_backendselect it; Tesseract remains the default. Pinned model setup
and repeated scan comparisons report text quality, geometry, latency and memory.
Breaking: exhaustive RustMarkkitBuilderliterals also need
pdf_ocr_backend,pdf_ocr_detection_modelandpdf_ocr_recognition_model. -
PDF layout, reading order and table extraction: glyph-positioned words,
column reconstruction, ruled tables with merged cells, conservative borderless
tables and wrapped cells; bold/italic, numbered lists, tagged heading roles and
ActualText; optional repeated header/footer removal. Layout JSON includes
source runs/words and semantic blocks/lines/cells linked to IR provenance. -
Opt-in native PDF OCR (
pdf-ocr, CLI--ocr) with Rust Hayro rendering and installed Tesseract,
bounded raster size/output/deadline and configurable languages. WASM now supports
PDF text/layout/tables; Node and Python expose layout and native OCR options.
Python gains structuredextract_document_sync. -
just eval-pdf: 20 authored PDF scenes across default/layout modes, including
column, table, wrapped-cell, tagging and list expectations.
Breaking: exhaustive RustMarkkitBuilderliterals must includepdf_layout,
pdf_remove_repeated_headers,pdf_ocr, andpdf_ocr_language; builder methods
and..Default::default()remain valid. -
Public WCXB and AgentDocBench evaluations through Mira (
just eval-public), with
pinned/verified corpora, a release-build baseline regression gate, per-type/format
quality and conversion timings. PR/push runs use a fixed slice; nightly runs cover
the full development selection after excluding 139 upstream dev/test duplicates. -
markkit_qaLLM eval (just eval-llm): models answer 23 questions about the eval pages from
markkit markdown, main-content markdown or raw HTML, scored on correct answers with token usage
per input. Targets: Meta Muse Spark 1.3 contributor via OpenRouter and Claude Sonnet 5.5;
key-gated (OPENROUTER_API_KEY,ANTHROPIC_API_KEY, from Doppler). -
XLSB (Excel binary workbook) support in the
spreadsheetfeature, via a new bounds-checked
reader: values, shared strings, dates and durations, hidden-sheet skipping, row/column caps and
the workbook title. Previously XLSB returnedUnsupportedFormat. -
markkit mcp: Model Context Protocol server over stdio exposing themarkkittool
(tools/list,tools/call). URL fetching keeps the SSRF guard;--no-urlkeeps it offline,
theextractlimit flags and--max-output-charsbound each call. -
EPUB input (
epubfeature, implieshtml, inall_formats;.epub,application/epub+zip, sniffed
from themimetypeentry): spine chapters through the HTML parser, OPF title, DRM-encrypted books
rejected. NewFormat::Epub,Error::EpubExtract,ExtractionStats::chapters,WarningCode::MissingChapter. -
ODT input (
odtfeature, inall_formats;.odt, OpenDocument text content type, sniffed from the
ODFmimetype): headings, Title style, bold/italic/strike, links, lists, tables, with the same
bounded ZIP/XML reader as DOCX. NewFormat::Odt,Error::OdtExtract. -
Email input (
emailfeature, inall_formats;.eml,message/rfc822): subject as title, From /
To / Cc / Date, plain-text body (HTML alternative converted when there is no plain part) and an
attachment list. NewFormat::Eml,Error::EmailExtract,ExtractionStats::attachments,WarningCode::EncodingProblem. -
Jupyter notebook input (
.ipynb,application/x-ipynb+json, nbformat 4), always on: Markdown
cells, code cells as fenced blocks tagged with the kernel language, text outputs and ANSI-free
tracebacks; images/HTML outputs skipped. NewFormat::Notebook,Error::NotebookExtractand
ExtractionStats::cells. -
CSV and TSV input (
text/csv,text/tab-separated-values,.csv,.tsv), always on: one GFM
table, RFC 4180 quoting,;/|/tab delimiter detection, bounded bymax_sheet_rows/
max_sheet_cols(truncated_tablewarning). NewFormat::Tsv. -
Plain text input (
text/plain,.txt), always on: paragraphs and hard breaks through the IR,
UTF-8/UTF-16 BOM decoding, control characters dropped,invalid_utf8warning on lossy decode. -
Markdown input (
markdownfeature, inall_formats;text/markdown,.md): re-parsed with
pulldown-cmark and rendered back, so raw HTML never passes through. Front mattertitle:or the
first#heading becomesExtraction::title. Available in the CLI, Python, Node and WASM packages;formatserializes as
"text"and"markdown". -
PPTX support behind the new
pptxfeature (included inall_formats, so in the CLI and the
Python/Node bindings): one## Slide N: <title>section per slide with bullets, text boxes,
tables, hyperlinks and speaker notes. Hidden slides are skipped with ahidden_slide_skipped
warning unlessinclude_hidden_content(true). Legacy.pptis detected as the newFormat::Ppt
and rejected explicitly.Error::PptxExtractreports malformed presentations. -
Nightly cargo-fuzz targets for every parser and the renderer (
crates/markkit/fuzz,just fuzz,
.github/workflows/fuzz.yml), each checking the output-safety oracle. -
HTML page metadata:
extract_documentfillsExtraction::title(Open Graph, JSON-LD or
<title>) and the newExtraction::metadata(description, author, published date, language,
canonical URL, site name, lead image) from<meta>, Open Graph,<link rel=canonical>and
JSON-LD.markkit extract --jsonincludesformat,titleandmetadata. -
IR v2: footnotes (
[^1]), definition lists (Term/: definition), task lists (- [x]),
figures with captions, table column alignment (:---:) andcolspan/rowspan(laid out on a
grid; GFM has no spans). HTML maps GitHub and Pandoc footnote markup,<dl>, checkbox list items,
<figure>/<figcaption>and table spans/alignment. Row-header<th>cells in table bodies are
no longer dropped. -
Document.ir_version(markkit::ir::IR_VERSION = 2) is serialized with the IR JSON. -
PDF extraction (
pdffeature, on in the CLIall_formatsbuild and the Python/Node bindings):
the text layer becomes paragraphs, font-size headings and bullet lists, with/Titleas
Extraction::titleandstats.pages. Pure Rust (hayro-syntax), no OCR. Fonts map through
ToUnicodeCMaps, simple-font encodings and/Differences. New warningstruncated_pdf,
pdf_unmapped_font,pdf_no_text. Encrypted PDFs returnUnsupportedFormat. -
Limitsfieldsmax_pdf_pages(10 000),max_pdf_stream_size(64 MiB) and
max_pdf_decoded_size(256 MiB), also on the builder, as CLI flags (--max-pdf-pages, ...),
PythonLimits(...)arguments and Node options (maxPdfPages, ...). PDF extraction also
honourstimeoutandmax_output_size. -
Relative URL resolution: links, images and metadata URLs resolve against the new
MarkkitBuilder::base_url(CLI--base-url) and the page's<base href>;extract_urluses
the final URL after redirects. Absolute and fragment-only URLs are left unchanged. -
Math:
$`tex`$and```mathblocks from MathML (application/x-texannotation), KaTeX and MathJax output. -
IR transforms:
MarkkitBuilder::transform(..)runsTransformpasses after parsing and before
rendering, for every format. Built-instransform::NormalizeHeadingsandtransform::DropImages;
transform::from_fnfor closures;Document::visit/visit_mutto walk the tree. -
Declarative HTML element rules:
MarkkitBuilder::html_rule(".note", ElementAction::BlockQuote { .. })
maps elements by CSS selector to skip / unwrap / heading / paragraph / block quote (with title) /
code / emphasis / text, before the built-in mapping. CLI:markkit extract --rules rules.json. -
Pluggable parsers:
MarkkitBuilder::parser(..)registers aregistry::FormatParserthat handles
detected formats (e.g. PDF or CSV) or claims inputs by content, before the built-ins. Its IR goes
through transforms and the shared renderer; panics become the newError::Parser. -
JSON Schema for the IR at
schema/ir.schema.json;json-schemafeature addsmarkkit::ir::json_schema(). -
Per-block provenance:
MarkkitBuilder::track_sources(true)records aSourceon each IR block
(HTML element XPath, DOCX body block index, spreadsheet sheet and A1 range) for citations. -
Markkit::parse_document/parse_document_syncreturn the IR plus metadata (ParsedDocument)
for any supported format;ParsedDocument::render()produces theExtraction. -
toolfeature:markkit::tool::MarkkitTool, an LLM agent tool following the Everruns
toolkit-library contract (builder, OpenAI tool definition, input/output schemas,tower::Service,
single-useToolExecution,en-US/uk-UAtext). One call converts aurl,htmlor base64
document to Markdown, with output capped bymax_output_chars. Example:examples/agent_tool.rs. -
@everruns/markkit-wasm: browser / edge WebAssembly package (crates/markkit-wasm), single-threaded,
no special headers.Markkitclass (HTML, DOCX, XLSX/XLS/ODS with validated camelCase options) and
MarkkitTool. Built bycrates/markkit-wasm/scripts/build.sh, published bypublish-wasm.yml. -
Node (
@everruns/markkit): every function takes an optional trailingoptionsobject with all
builder settings (selectors, links/images, input, archive and sheet limits) and the URL policy
(allowPrivateNetworks,allowedHosts,maxRedirects,maxProcessingSecs). New
extractDocument/extractDocumentSyncreturn Markdown with title, format, warnings, stats and
page metadata. -
Markkit::extract_url_document:extract_urlwith format, title, warnings and stats. -
Main-content detection:
MarkkitBuilder::main_content(true)(CLI--main-content) keeps only
the article body of a web page, Readability-style, dropping navigation, sidebars, comments, share
bars and related-link blocks. Off by default; include selectors take precedence; falls back to the
full page when no article-like block is found. -
Every resource limit is configurable outside Rust: CLI flags (
--max-output-size,--timeout,
--max-nesting-depth,--max-nodes, archive / sheet / redirect flags;--max-sizekept as an
alias of--max-input-size), Pythonmarkkit.Limits(...)passed aslimits=to every function,
and flat Node.js and WASM option keys (maxOutputSize,maxNodes,maxNestingDepth, plus
timeoutin Node.js). -
Node.js and WASM options gain
baseUrlandmainContent; Pythonextract_html_sync_with_options
gainsbase_url=andmain_content=, matching the core builder.
Security
-
Resource limits on every aspect, in one
markkit::Limitsstruct (MarkkitBuilder::limits(..)or
per-field setters). New:timeout(default 60 s) now bounds parsing and rendering, not just URL
fetch;max_output_size(128 MiB) stops output amplification (e.g. one wide table row padding
thousands of rows);max_nodes(5 000 000) caps parsed HTML DOM / DOCX XML nodes;
max_nesting_depth(256) is configurable, with a hard ceiling of 512 that keeps deep input off
the host stack. Violations returnError::ResourceLimitnaming the limit. -
PDF decompression bombs: every stream in the file is decoded under the PDF size limits before
the parser runs (object streams included), interpreted content is budgeted so reused form
XObjects cannot multiply work, and stream filters that cannot be verified are refused. -
extract_url(CLI, Python and Nodeextract_urltoo) now refuses non-public destinations by default:
loopback, private, link-local / cloud metadata and other reserved addresses, checked on the URL,
after DNS resolution and on every redirect. Onlyhttp/httpsare fetched. Redirects are capped
(max_redirects, default 5), the body is bounded bymax_input_sizewhile streaming, and the whole
fetch bymax_processing_secs. New builder optionsallow_private_networks(true)andallow_host(..);
refusals return the newError::UrlBlocked. -
Markdown output is now escaped: text from documents can no longer emit raw HTML (
<img onerror>),
links, emphasis, headings or list markers; code blocks use a fence longer than any backtick run
inside. Links with schemes other thanhttp,https,mailto,tel,ftpor relative URLs
(e.g.javascript:) and images other thanhttp/https/relative/rasterdata:image/*are
dropped, keeping their text. URLs percent-encode( ) < > \and spaces. -
Markdown structure from documents can no longer break out of its container: code blocks in table
cells and headings are flattened to one line, list item bodies are indented by the marker width
(nested content under1.items now nests correctly), and nested links render as text. -
The JSON IR of DOCX and spreadsheet tables now holds raw text (pipes were pre-escaped before).
-
Math TeX (taken from page markup) renders as code, GitHub's
$`tex`$and```math
forms, instead of$tex$/$$, so it can no longer emit raw HTML or links in plain GFM. -
XLS files with truncated or inconsistent BIFF records (found by fuzzing) are rejected with an
error instead of aborting the process inside calamine. Formula token streams are ignored
(cached values were already the only thing rendered). -
Hidden content is skipped by default as a prompt-injection defence: HTML elements with
hidden,
aria-hidden="true"or inlinedisplay:none/visibility:hidden/opacity:0/font-size:0,
<template>, and DOCX hidden (w:vanish) runs (warninghidden_content_skipped). Opt back in
withinclude_hidden_content(true).
Added
markkit-benchharness (just bench): per-case latency, ops/s, throughput, heap allocations and
peak heap, plus process peak RSS, over a generated HTML/DOCX/XLSX/ODS corpus. Runs are saved as
JSON + Markdown incrates/markkit-bench/results/and committed.
Changed
- Breaking:
Error::ResourceLimitcarries aLimitExceeded { kind: LimitKind, detail }instead of
aString.LimitKindnames theLimitsfield (MaxInputSize,Timeout,MaxArchiveEntrySize,
...);Error::limit_kind()returns it.ResourceLimit(_)patterns and the error message are unchanged. - DOCX uses far less memory: body blocks are converted while
document.xmlis parsed and freed
right after, and the XML tree is compact (interned names and values, exact-size lists). A 1.5 MB
document.xmlpeaks at 3.9 MiB instead of 18.5 MiB, with half the allocations. Markdown
rendering allocates less for every format. - HTML peak memory down about 35% and allocations about halved on large pages (DOM arena
pre-sized, inline node lists sized to their content, no copy of text before whitespace
collapsing). - Spreadsheets make a third fewer allocations per cell (XLSX values are formatted without an
intermediate copy and trimmed in place). - Dependencies:
tokiois optional, pulled in only byhttp_clientandtool, so default and
docx,spreadsheetbuilds no longer link it. CI checks both trees.serde_jsonstays required
(always-on.ipynbinput). - Breaking: limit fields moved from
MarkkitBuildertoMarkkitBuilder::limits
(config().max_input_size→config().limits.max_input_size);max_processing_secsfield is
nowlimits.timeout: Duration. Builder setters are unchanged, plus newtimeout,
max_output_size,max_nodes,max_nesting_depth,limits. HTML nesting now flattens at depth
256 (was 200). - Breaking (features):
http_clientis no longer a default feature; the default build pulls in
no HTTP/TLS stack. Library users callingextract_urladdfeatures = ["http_client"]. The CLI and
the Python/Node packages still enable it, so theirextract_urlis unchanged. - Breaking:
Erroris#[non_exhaustive](newError::Transform); matches need a_arm. - Breaking:
Extraction::warningsandParsedDocument::warningsareVec<Warning>
(code: WarningCode+detail: String) instead of"code: detail"strings, so callers can match
on the code.Warning'sDisplaykeeps the old string form; JSON serializes
{"code": "truncated_sheet", "detail": "..."}. The agent tool output is unchanged.
Node and WASMextractDocumentreturnwarningsas{ code, detail }objects too. MarkkitimplementsCloneandDebug.- Breaking (IR API):
Node,Document,ListItemand the new IR structs are#[non_exhaustive];
matches need a_arm and structs are built with constructors.Node::Tablecells are now
TableCell(children,colspan,rowspan) with analignmentsfield. Block variants gain a
sourcefield (use..in patterns,Node::paragraph/Node::headingto construct). DOCXgridSpanis
carried ascolspan. markkit-evalis now a mira eval study.just evalruns
markkit_extract, an offline extraction-quality eval over ten realistic HTML pages scored for
completeness, accuracy, formatting and noise (needscargo install mira-cli). Amodeaxis
compares default extraction withmain_content; dated results are committed in
crates/markkit-eval/results/.- Design docs moved from
specs/to an OKF v0.2 knowledge bundle inknowledge/, validated in CI. - CI workflows declare read-only default permissions and do not persist checkout credentials.
- CI runs every example; criterion benchmarks run with
just bench-criterion. - README, SECURITY and binding docs corrected: Python module is
markkit. - Dependencies: drop unused
async-trait,futures,regex,unicode-segmentation,encoding_rs,
base64,mime,lol_html(core) andtracing-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. Theloggingfeature is reserved and enables onlytracing.
Fixed
- HTML: deeply nested input no longer costs quadratic time. 687 KiB of nested
<div>s took
12.6 s and 292 KiB of unclosed nested tables ran past the 60 s timeout; tags nested past
max_nesting_depthare now dropped (text kept) before html5ever parses, so both take
milliseconds. - HTML: rows of nested tables are no longer copied into every enclosing table (output grew 4x
per nesting level). - HTML: text flattened past
max_nesting_depthno longer includes<script>,<style>,
<template>and other non-content element bodies. - Spreadsheets: a sheet with a single row now renders that row as data under Excel column letters
(| A | B |) instead of as a header with no rows. - Spreadsheets:
Extraction.titleis filled from document properties (XLSXdocProps/core.xml,
ODSmeta.xml, XLSSummaryInformation). Format::from_content_typedetects XLSB (application/vnd.ms-excel.sheet.binary.macroEnabled.12)
as the newFormat::Xlsbinstead ofXlsx;.xlsbfiles andxl/workbook.bincontainers too.- XLSX packages missing
_rels/.relsno longer fail inside calamine. - Release builds use
panic = "unwind", so a parser panic becomes an error instead of aborting the
CLI or the host Python/Node process. - Text that only looks like a block marker is no longer escaped:
4.6 out of 5stays4.6, not
4\.6; same for#tagand+1. Markers followed by whitespace (1.,#,+) are still
escaped. - Exclude selectors now apply to
<li>,<tr>,<th>and<td>; they were ignored there. - 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 Binstead of# A\n\nB), which also broke headings and tables as markdown.