Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Interweave has served it's purpose rather well over the years, but has grown to accrue lots of cruft and questionable implementations (we're on v12 already). I believe it's time to rewrite this library from the ground-up, to improve the API, remove weirdness, greatly reduce filesize, improve performance, and much more.
Primary goals:
Matcher
s are nowcreateMatcher
This new functional API accepts a regex pattern, some customizable options, and a render factory. It then returns a "matcher" to be used by the parser.
Filter
s and transformers are nowcreateTransformer
Filters and transformers did similar things, they operated on DOM/HTML elements. This new API will unify them both into a more streamlined API, where you can easily mutate attributes/elements, replace with new elements, or inject React components.
Like matchers, they use a new functional API, which accepts a tag name they want to operate on (or
*
for all), and a factory to transform the element. Some examples.