text_around
Retrieve cleaned text around an element or matched text, returning before, match, and after content to provide page context.
Instructions
Return cleaned surrounding text around an element ref or the best ranked text match. Returns {ref, before, match, after, text}.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ref | No | Optional element ref like e:142 | |
| text | No | Optional text to locate when ref is omitted | |
| selector | No | Optional CSS selector to scope context | |
| context_chars | No | Characters before/after the target (default 400) |