Document Data

Parse HTML and Markdown into target-local named document trees, edit text, and expose deterministic UTF-8 HTTP response bodies.

Blocks

Use parse HTML ... as document ... or parse Markdown ... as document ..., then inspect, replace, or serialize its text. Tree locations use $ or numeric paths such as $[0][1]. HTML also supports one simple tag, #id, or .class selector.

Safety boundary

Parsing does not sanitize HTML, execute scripts, or mount a DOM. HTML/Markdown conversion is rejected because it may be lossy. The extension is unsandboxed and its DOCUMENT_DATA_MVP flag defaults to off.

Development

Run pnpm run check. See the repository README and architecture documents for limits and the Named Data provider contract.

Document Data: complete block reference

All 8 blocks are documented below, including compatibility blocks and blocks available through optional features. Select a block to read its behavior, arguments, default values, and menu choices. Each block has a permanent link.

parse HTML [TEXT] as document [NAME]

Parse HTML into a target-local named document tree. This does not sanitize HTML.

Block type: COMMAND. Opcode: parseHtml. Permanent link

ArgumentTypeDefault valueMenu choices
TEXTSTRING<p>Hello</p>
NAMESTRINGpage

parse Markdown [TEXT] as document [NAME]

Parse Markdown into a target-local named syntax tree.

Block type: COMMAND. Opcode: parseMarkdown. Permanent link

ArgumentTypeDefault valueMenu choices
TEXTSTRING# Hello
NAMESTRINGpage

document [NAME] exists?

Report whether the current target has the named document.

Block type: BOOLEAN. Opcode: hasDocument. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGpage

delete document [NAME]

Delete the named document from the current target.

Block type: COMMAND. Opcode: deleteDocument. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGpage

kind of document [NAME]

Return html or markdown.

Block type: REPORTER. Opcode: documentKind. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGpage

text in document [NAME] at [LOCATION]

Get text at the root, a numeric tree path, or a simple HTML selector.

Block type: REPORTER. Opcode: getDocumentText. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGpage
LOCATIONSTRING$

replace text in document [NAME] at [LOCATION] with [TEXT]

Immutably replace text at the selected node.

Block type: COMMAND. Opcode: replaceDocumentText. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGpage
LOCATIONSTRING$
TEXTSTRINGHello

serialize document [NAME] as [FORMAT]

Deterministically serialize a document in its native format. Cross-format conversion is rejected as lossy.

Block type: REPORTER. Opcode: serializeDocument. Permanent link

ArgumentTypeDefault valueMenu choices
NAMESTRINGpage
FORMATSTRINGhtml
  • html
  • markdown

このブロックの固定入力編集と互換性

Repository guide and examples

固定入力の編集

対応GUIの固定入力機能は既定OFFです。既存値は開いただけでは変更せず、reporter接続は評価・置換しません。新しい選択と有限JSON数値入力のみを検証して保存し、既存の補正・丸め処理を維持します。機能OFFで従来の編集へ戻せます。

対象入力・Schemaの正本・互換性・切戻し