Releases: demyanovs/php-highlight
Releases · demyanovs/php-highlight
3.0.0
Added
- Support for
<pre><code>pattern (in addition to<pre>) for better Markdown compatibility - Support for
class="language-*"attribute on<code>tag for language detection - Fluent interface for
showLineNumbers()andshowActionPanel()methods HighlighterFactoryclass for creating highlighter instances based on languageCodeBlockWrapperclass for separating presentation logic from highlightingLanguageNormalizerclass for normalizing language identifiers with aliases support- Custom exceptions:
InvalidLanguageException,InvalidThemeException,ThemeNotSetException - PHP as default language for code blocks without specified language
- Comprehensive test suite
Changed
- BREAKING: Removed Singleton pattern from all highlighter classes (
HighlighterPHP,HighlighterXML,HighlighterBash) - BREAKING: Made
HighlighterBasean abstract class (cannot be instantiated directly) - BREAKING: Added
ext-domPHP extension requirement (previously optional with regex fallback) - Improved HTML attribute parsing using
DOMDocumentwith regex fallback - Enhanced syntax highlighting logic in
HighlighterBase - Improved XML/HTML highlighting: fixed line-by-line processing, proper attribute highlighting
- Updated PHPDoc comments throughout the codebase
Fixed
- Fixed issue with extra empty lines at the beginning and end of code blocks
- Fixed line numbering