Skip to main content

Module structural_replace

Module structural_replace 

Source
Expand description

structural_replace: match blocks by type and text, then wrap, retype, unwrap or remove each.

Structs§

StructuralAction
What to do with each match. Exactly one field.
StructuralMatch
Which blocks to act on. Every given condition must hold; text conditions look at the visible text of the block’s content, without markup.
StructuralReplaceResult
The blocks that matched and the pages the action changed.

Enums§

Action 🔒

Functions§

block_text 🔒
The visible text of the block’s content, without markup.
is_match 🔒
op_for 🔒
parse_action 🔒
structural_replace
Applies action to each block of pages that pattern matches, by the page tool’s rules. Fails without changing anything when expected_count differs from the matches.