# html

URL: /patitas/api/lexer/scanners/html/
Section: scanners
Description: HTML block mode scanner mixin.

---

> For a complete page index, fetch /patitas/llms.txt.

Open LLM text
(/patitas/api/lexer/scanners/html/index.txt)

Share with AI

Ask Claude
(https://claude.ai/new?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fscanners%2Fhtml%2Findex.txt)

Ask ChatGPT
(https://chatgpt.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fscanners%2Fhtml%2Findex.txt)

Ask Gemini
(https://gemini.google.com/app?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fscanners%2Fhtml%2Findex.txt)

Ask Copilot
(https://copilot.microsoft.com/?q=Please%20help%20me%20understand%20this%20documentation%3A%20%2Fpatitas%2Fapi%2Flexer%2Fscanners%2Fhtml%2Findex.txt)

Module

#
`lexer.scanners.html`

HTML block mode scanner mixin.

1Class

## Classes

`HtmlScannerMixin`

14

▼

Mixin providing HTML block mode scanning logic.

Scans content inside HTML blocks until the appropr…

Mixin providing HTML block mode scanning logic.

Scans content inside HTML blocks until the appropriate end condition
based on the HTML block type (1-7 per CommonMark spec).

#### Attributes

Name
Type
Description

`_source`

`str`

—

`_pos`

`int`

—

`_source_len`

`int`

—

`_mode`

`LexerMode (/patitas/api/lexer/modes/#LexerMode)`

—

`_html_block_type`

`int`

—

`_html_block_content`

`list[str]`

—

`_html_block_start`

`int`

—

`_consumed_newline`

`bool`

—

#### Methods

Internal Methods
6

▼

`_save_location`

0

▼

Save current location for O(1) token location creation.

`def _save_location(self) -> None`

`_find_line_end`

0

`int`

▼

Find end of current line.

`def _find_line_end(self) -> int`

##### Returns

`int`

`_commit_to`

1

▼

Commit position to line_end.

`def _commit_to(self, line_end: int) -> None`

##### Parameters

Name
Type
Description

`line_end`
`—`

`_make_token`

6

`Token (/patitas/api/tokens/#Token)`

▼

Create token with raw coordinates. Implemented by Lexer.

`def _make_token(self, token_type: TokenType, value: str, start_pos: int, *, start_col: int | None = None, end_pos: int | None = None, line_indent: int = -1) -> Token`

##### Parameters

Name
Type
Description

`token_type`
`—`

`value`
`—`

`start_pos`
`—`

`start_col`
`—`

Default:`None`

`end_pos`
`—`

Default:`None`

`line_indent`
`—`

Default:`-1`

##### Returns

`Token (/patitas/api/tokens/#Token)`

`_emit_html_block`

0

`Iterator[Token (/patitas/api/tokens/#Token)]`

▼

Emit accumulated HTML block. Implemented by HtmlClassifierMixin.

`def _emit_html_block(self) -> Iterator[Token]`

##### Returns

`Iterator[Token (/patitas/api/tokens/#Token)]`

`_scan_html_block_content`

0

`Iterator[Token (/patitas/api/tokens/#Token)]`

▼

Scan content inside HTML block until end condition.

**The end condition depend…

`def _scan_html_block_content(self) -> Iterator[Token]`

Scan content inside HTML block until end condition.

The end condition depends on the HTML block type:

- Type 1: Ends with closing tag (, , etc.)

- Type 2: Ends with -->

- Type 3: Ends with ?>

- Type 4: Ends with >

- Type 5: Ends with ]]>

- Types 6, 7: End with blank line

##### Returns

`Iterator[Token (/patitas/api/tokens/#Token)]`
