code wiki / (root) / nx_html_to_text.nx

nx_html_to_text.nx

buildroot/runtime/nx_html_to_text.nx

19624 B476 linesdepth 3pulls 3 transitivereach 79 importersview sourcekind librarytopic html
docsdependenciesstructsconstsfunctions

about

nx_html_to_text.nx -- HTML → plain text rendering for the sovereign nishi browser's text mode. Strips tags, keeps text content, collapses whitespace, decodes 110 named entities (data-driven nx_html_entities: quotes/dashes/symbols/ accented-latin/arrows -- &mdash; &rsquo; &copy; &eacute; ...) AND numeric character references (&#39; decimal / &#x27; hex, UTF-8 encoded), inserts newlines around block-level elements (p, h1-h6, div, li, br, hr, pre, blockquote, table, tr), suppresses content inside <script> and <style>. nbsp (named or &#160;) renders as a space in text mode. (X-HTML-ENT-001 + named-table follow-on.) CAPABILITY_COMPLETENESS: PARTIAL. MISSING_CAPABILITIES: - the full HTML5 entity table (2000+ refs; 110 common named + all numeric refs covered) and entities without ';' terminator - CSS-driven inline-vs-block (assumes tag-name defaults) - bidi/RTL text shaping Per [[feedback-no-skip-paths-as-error-codes]] these are named follow-on substrate primitives, not silent skips. Built per F7 post-order DFS. expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 50 importers

nx_syscalls.nx nx_html_entities.nx nx_html_to_text.nx _dlr_fetch_one.nx nishi.nx nx_browse_text.nx nx_browser_buyguard.nx nx_browser_buyguard_gate.nx nx_browser_local_test.nx nx_browser_page_demo_test.nx nx_browser_render_own_test.nx nx_chapter_split.nx nx_charset_test.nx

diagram shows first 10 each side; +0 more imports, +40 more importers in the complete lists below.

imports: nx_syscalls.nxnx_html_entities.nx

imported by: _dlr_fetch_one.nxnishi.nxnx_browse_text.nxnx_browser_buyguard.nxnx_browser_buyguard_gate.nxnx_browser_local_test.nxnx_browser_page_demo_test.nxnx_browser_render_own_test.nxnx_chapter_split.nxnx_charset_test.nxnx_corpus_fetch.nxnx_corpus_ingest.nxnx_crawl_bfs.nxnx_crawl_doc.nxnx_crawl_https.nxnx_crawl_main.nxnx_crawl_polite.nxnx_crawl_run.nxnx_crawl_web.nxnx_diora_live_reach.nxnx_entity_discover.nxnx_epub_book.nxnx_epub_read.nxnx_fb2_book.nxnx_fin_extract.nxnx_html_entities_render_test.nxnx_html_to_text_entity_test.nxnx_html_to_text_oom_gate.nxnx_html_to_text_real_test.nxnx_html_to_text_test.nxnx_js_headless_render.nxnx_js_hydrate_index_gate.nxnx_kf8_book.nxnx_library_extract.nxnx_live_crawl.nxnx_live_https.nxnx_mobi_book.nxnx_multi_fetch.nxnx_night_extract_test.nxnx_page_fetch_tmp.nxnx_page_get_test.nxnx_research_extract_sovereign_test.nxnx_research_web.nxnx_search_crawl_server.nxnx_sourced_census_test.nxnx_uxf_extract.nxnx_uxf_extract_avro.nxnx_webpub_extract.nxnx_wiki_answer_index.nxnx_zerodt_extract.nx

structs

245struct H2tState

consts

31const NX_H2T_OK: i64 = 0
32const NX_H2T_ERR_OVERFLOW: i64 = 1

functions

36func h2t_lc(b: i64) -> i64
41func h2t_is_ws(b: i64) -> i64
called by 1: h2t_emit_text_byte
50func h2t_is_name(b: i64) -> i64
57func h2t_emit_byte(out: *u8, out_pos: *i64, cap: i64, b: i64) -> i64
65func h2t_name_eq_lit(src: *u8, off: i64, len: i64, lit: *u8, lit_len: i64) -> i64
80func h2t_is_block_tag(src: *u8, off: i64, len: i64) -> i64
104func h2t_is_suppress_tag(src: *u8, off: i64, len: i64) -> i64
called by 1: nx_html_to_text_x calls 1: h2t_name_eq_lit
120func h2t_decode_numeric(src: *u8, src_len: i64, off: i64, out_cp: *i64) -> i64
called by 1: h2t_decode_entity
156func h2t_decode_entity(src: *u8, src_len: i64, off: i64, out_cp: *i64) -> i64
187func h2t_scan_name(src: *u8, src_len: i64, p: i64) -> i64
called by 1: h2t_scan_tag calls 1: h2t_is_name
198func h2t_skip_to_gt(src: *u8, src_len: i64, p: i64, is_self_close: *i64) -> i64
called by 1: h2t_scan_tag
214func h2t_scan_tag(
253func h2t_state_new() -> *H2tState
called by 1: nx_html_to_text_x calls 1: sys_mmap
266func h2t_emit_raw(out: *u8, cap: i64, s: *H2tState, b: i64) -> i64
called by 1: nx_html_to_text_x
276func h2t_find_href(src: *u8, start: i64, end: i64, out_off: *i64, out_len: *i64) -> i64
called by 1: nx_html_to_text_x calls 2: h2t_lch2t_is_name
319func h2t_emit_text_byte(out: *u8, cap: i64, s: *H2tState, b: i64) -> i64
343func h2t_emit_newline(out: *u8, cap: i64, s: *H2tState) -> i64
called by 1: nx_html_to_text_x
359func h2t_emit_codepoint(out: *u8, cap: i64, s: *H2tState, cp: i64) -> i64
386func nx_html_to_text_x(src: *u8, src_len: i64, out: *u8, out_cap: i64, emit_links: i64) -> i64
473func nx_html_to_text(src: *u8, src_len: i64, out: *u8, out_cap: i64) -> i64