-
Notifications
You must be signed in to change notification settings - Fork 186
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v4.0 #354
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Refactor scanner to emit more granular tokens The DOMAIN token (among others) has been removed in favour of WORD, UWORD and other tokens. SCHEME (formerly PROTOCOL) tokens now come in several flavours. Includes additional facilities for token groups, which will be useful for future plugins down the line Also fixes file URL behaviour * Update plugins to use new scanner tokens Also improves hashtag and mention plugin accuracy * Update tests to work with new scanner * Better workspace packages to improve build order * Update benchmark require * Remove resolved FIXME * Additional tests for linkify register functions Fixes #171 Fixes #245 Fixes #351
Pull Request Test Coverage Report for Build 1329545737
💛 - Coveralls |
Pull Request Test Coverage Report for Build 1329756125Warning: This coverage report may be inaccurate.This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.
Details
💛 - Coveralls |
With updated simple-html-tokenizer, now correctly handles HTML-encoded <, >, ", and & characters
- New toFormatted* token methods that accept options - New render() token method to return final HTML tag intermediate representation - New Options implementation to support token rendering - Removed Options#resolve() method in favour of render - Update interfaces to use new unified rendering
For IE11
These were deprecated in v3. Includes additional cleaner file/directory structure
To avoid running too many browsers in parallel
Previously, when writing the parsed HTML back to a string, linkify-html ignored the selfClosing flag on StartTag tokens. Now it replaces it the same way in which it was found Fixes #375
Also separated out plugin definition and registration to make testing easier
* Initial refactor of exports and types for plugin system * Refactor plugins to use updated linkify plugin API * Initial untested keyword plugin implementation * Keyword test and transition bug fixes * State machine refactor for native FSM collections support Includes scanner and parser refactor to use the revamped scanner API. Praying that this will be the last parsing refactor 🙏🙏🙏 * Passing implementation of all plugins with new token API Including keyword plugin * Scanner performance optimizations Improves initialization speed to be more comparable to v3
For consistency
IE doesn't like cloning
Will now default to the static State.groups collections
* Initial IP address plugin with IPv4 support IPv6 support incoming * Adapt to new transition interface * Working IPv4 and IPv6 plugins IPv6 has some bugs but works pretty well overall * Add test for before plugin applied
No longer have to specify null type to specify opts, can just omit the argument
Might still work but not guaranteed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Breaking Changes
linkifyjs/string
,linkifyjs/html
,linkifyjs/plugins/*
packagesmailto:
now have typeurl
instead ofemail
Added
linkify-plugin-ip
package for detecting IP addresses (v4 and v6 supported)linkify-plugin-keyword
package for detecting arbitrary keywordslinkify.find()
function accepts a thirdoptions
argument for output formattingtoFormattedString(options)
,toFormattedHref(options)
andtoFormattedObject(options)
that accept alinkify.Options
objectrender
option to override link renderingoptionalSlashSlash
argument forregisterCustomProtocol
to allow links that don't require//
afterscheme:
Fixed
linkify-html
truncate
)Fixes #171
Fixes #219
Fixes #245
Fixes #338
Fixes #350
Fixes #351
Fixes #357
Fixes #358
Fixes #362
Fixes #367
Fixes #372
Fixes #374
Fixes #375
Fixes #349
Fixes #365
Fixes #376
Fixes #378
Fixes #385
Fixes #387