All notable changes to this project documented in this file.
Releases following Semantic Versioning specification.
- Refactored HighlighterInterface to be more flexible [BC break]
- Refactored HtmlHighlighter to follow template method pattern (much easy to extend)
- Refactored MarkdownHighlighter to aware of HTML content (extends HtmlHighlighter)
- Added MatcherFactory and ReplacerFactory
- Added PHP 8 compatibility
- Renamed class
VStelmakh\UrlHighlight\Matcher\Match
toUrlMatch
Since PHP v8.0
match
is a reserved keyword.
This will affect you if custom Validator or Highlighter implemented. Consider expecting UrlMatch instead ofMatch
in your implementations.
- Fixed match complex urls with brackets (e.g. ELK urls)
- Improved matcher performance (~3x faster)
- Fixed html entity encoder regex builder (not all html entities were encoded)
- Added fallback to encoded matcher to skip match if encoder not able to encode
- Improved url match regex to cover more cases
- Added match emails by default in validator
- Added html highlighter tag attributes
- Added markdown highlighter
- Replaced array configuration by specific interfaces: Validator, Highlighter, Encoder [BC break]
- Added support for html escaped input
- Fixed html highlight when href for urls contains
"
(double quote) - Added changelog
- Fixed match by host includes colon at the end (e.g.
example.com:
will not include colon anymore)
- Fixed match scheme without host (e.g.
http://
will not match anymore)
- Improved url regex (more strict scheme and host name)
- Changed to not match emails (temporary)
- Added
.gitattributes
to ignore dev files (e.g. tests) on export - Improved readme
- Added project logo
- Added configuration. Additional options could be provided via constructor:
match_by_tld
default_scheme
scheme_blacklist
scheme_whitelist
- Added locate urls without protocol using top level domain names
- Added check if string is url
isUrl
- Added parse urls from string
getUrls
- Added replace urls in string by html tags
highlightUrls