Skip to main content

Module html

Module html 

Source
Expand description

HTML 插件:手写标签扫描(零第三方依赖),对齐 Python html.parser 的块级语义。

规则(与 Python _HTMLCollector 一致):

  • h1..h6 → Heading(level);
  • p / div / br → Paragraph;
  • blockquote → Quote;li → List(无序,不区分 ol/ul);
  • pre → Code;table/tr/td/th → Table;
  • script / style / noscript / svg / head / title 整段跳过。

文本只做去首尾空白(不合并内部空白),与 Python 参考实现保持逐字可比。

Structs§

HtmlPlugin
html 插件:整页一组块。

Functions§

parse_blocks
解析 HTML 为块序列(畸形输入尽量降级,不 panic)。