core-conversion-architecture
/core-conversion-architecture
Wyjaśnia, jak rdzeń biblioteki html-to-markdown zamienia HTML na Markdown: skaner, przejście DOM i konwertery elementów.
- Autor
- xberg-io ↗
- Repozytorium
- html-to-markdown ↗
- Licencja
- MIT
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 2
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.
Co robi i kiedy
Wyjaśnia, jak rdzeń biblioteki html-to-markdown zamienia HTML na Markdown: skaner, przejście DOM i konwertery elementów.
Oryginalny opis (EN)
How the core crate turns HTML into Markdown: Tier-1 scanner, Tier-2 DOM walk, element converters, input validation and depth limits. Use when changing conversion output, parsing, or input-safety behavior in crates/html-to-markdown.
Jak działa
- Pipeline
- Input safety (not output sanitization)
Podgląd SKILL.md
---
type: Playbook
title: Core Conversion Architecture
description: "How the core crate turns HTML into Markdown: Tier-1 scanner, Tier-2 DOM walk, element converters, input validation and depth limits. Use when changing conversion output, parsing, or input-safety behavior in crates/html-to-markdown."
paths:
- "crates/html-to-markdown/src/**"
x-ai-rulez:
kind: skill
id: core-conversion-architecture
metadata:
name: core-conversion-architecture
---
# Core Conversion Architecture
All paths are under `crates/html-to-markdown/src/`.
## Pipeline
- `convert()` in `convert_api.rs` checks `max_input_size`, normalizes the input, tries Tier-1, then falls back to Tier-2.
- Tier-1: byte scanner in `converter/tier1/`.
- Tier-2: astral-tl DOM walk, `walk_node` in `converter/main.rs`; html5ever is used for tree repair.
- `ConversionOptions::tier_strategy` (`Auto` default, `Tier2`, `Tier1` testkit only) picks the path.
- Per-element converters live under `converter/` (`block/`, `inline/`, `list/`, `form/`, `media/`, `semantic/`, `text/`).
- Output is shaped by `ConversionOptions` in `options/conversion.rs` (heading style, list indent, code block style, newline style, whitespace mode).
- Caller traversal hooks: `HtmlVisitor` trait in `visitor/traits.rs` (feature `visitor`). There is no `DomWalker` trait.
## Input safety (not output sanitization)
- Converted Markdown is not safe to render as trusted content; callers sanitize downstream. See `SECURITY.md`.
- `validate_input()` in `validation.rs` rejects binary input: gzip/zstd/zip/PDF magic bytes, excess NUL bytes, high control-character ratio, undeclared UTF-16. It does not inspect HTML elements, attributes or URLs.
- `max_input_size` (`Option<u64>`) returns `ConversionError::InputTooLarge`; default is `None` natively and 2 MiB on wasm32.
- `max_depth` bounds the Tier-2 walk to avoid stack overflow; `effective_max_depth` in `converter/main_helpers.rs` defaults it and clamps caller values to a ceiling.
- `ConversionError::SanitizationError` exists in `error.rs` and in binding error mappings, but the core never constructs it.
- Script and style are stripped (markup fidelity, not security); `javascript:`/`data:` URLs and event-handler attributes pass through.
- There is no `SafetyConfig`, URL scheme allow-list or attribute allow-list.
Pliki w paczce (2)
- SKILL.md 2 KB
- index.md 1 KB
Wersje
W bazie nie ma innych skilli o nazwie core-conversion-architecture.
Migawka bazy z 13.11.2026 · wersja paczki 0d781e57b01d (skrót SHA-256 całej paczki)
Pobrania w ostatnich 30 dniach: 0 · ranking
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 100html-to-markdown
Pisze kod wywołujący bibliotekę html-to-markdown, która zamienia HTML na Markdown, Djot lub zwykły tekst w wielu językach. - 100data-flow
Opisuje potok renderowania JSON do niestandardowych elementów HTML dla tabel danych i list: konwersję kluczy toTagName i cykl od pobrania do DOM. - 100test-rust-core
Buduje i testuje rdzeń NeMo Relay w Rust, w tym crates adaptive, plugin i worker, oraz wspólne zmiany runtime. - 84html-to-markdown
Zamienia HTML na Markdown, Djot lub zwykły tekst w wielu językach programowania, z wydobyciem metadanych i tabel. - 100document-conversion
Konwertuje dokumenty między formatami: HTML na Markdown, dokument na Markdown i HTML na PDF, z zachowaniem struktury zamiast jej gubienia. - 100officeimo-conversion-operator
Pomaga zmieniać i walidować zachowanie konwersji OfficeIMO, w tym API DOCX, XLSX, PPTX, HTML, Markdown i PDF oraz diagnostykę wierności konwersji.