delete_lines
Removes lines or line blocks from a Scrapbox page by exact text match, supports deleting all occurrences, and prevents title-line deletion.
Instructions
Delete one or more lines from a Scrapbox page on cosense (scrapbox). Matches the target by exact text. If targetLineText contains newline characters, it is matched as a contiguous block of lines and removed as a whole. By default only the first match is removed; set matchAll to remove every (non-overlapping) occurrence. Refuses to delete the title line (the first line), which would rename or remove the page — use delete_page for that. Returns an error if no match is found. Requires COSENSE_SID. Uses my-cosense-project project as default if projectName is not specified.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| matchAll | No | If true, delete every occurrence of the target (a single line or a contiguous block). Block matches are non-overlapping. The operation is atomic: if any match includes the title line, the whole call is refused. Defaults to false (delete only the first match). | |
| pageTitle | Yes | Title of the page to modify | |
| projectName | No | Target project name. If not specified, defaults to 'my-cosense-project'. | |
| targetLineText | Yes | Exact text of the line(s) to delete. Matching is case-sensitive and requires full-line exact matches. If it contains newline characters, the consecutive lines are matched as a contiguous block and removed as a whole. |