text_around
Extract cleaned surrounding text around an element reference or the best-ranked text match, returning before, match, and after segments.
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 |
|---|---|---|---|
| context_chars | No | Characters before/after the target (default 400) | |
| ref | No | Optional element ref like e:142 | |
| selector | No | Optional CSS selector to scope context | |
| text | No | Optional text to locate when ref is omitted |