You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This PR adds search-and-replace functionality, allowing users to modify
link and image URLs using regex patterns. Users can now use
`!s/pattern/replacement/` syntax to find and replace URL content.
For now, only URLs support search-replace. General spans will come later
(see #376).
## High-level changes
- New `!s/pattern/replacement/` syntax for regex search-replace
operations, extending the existing `/pattern/` regex syntax
- Replace `Matcher` with a new `MatchReplace` in the `Selector`
variants' structs. This combines the original `Matcher` with an optional
replacement string
- Implement URL replacement for links and images
- Refactor selector error handling to use proper `Result<Select,
SelectError>` semantics instead of misusing `Err(MdElem)` for "no match"
cases. The new `Select` enum is now how we represent "matched
element(s), or the unmatched original"
## Breaking changes
- `MatchReplace` replaces `Matcher` in `Selector`s: All selector
matchers now take `MatchReplace` instead of `Matcher`
- New `crate::run::Error::SelectionError` variant, with an accompanying
struct
- `Table::retain_columns_by_header` and `Table::retain_rows` now require
an additional error type parameter, representing a possible error coming
from the passed-in function
## Review note
This PR is for a feature/integration branch. Please see the contributing
commits (each of which has its own PR) for the individual steps.
Resolves#277
0 commit comments