Skip to content

Conversation

@demyanovs
Copy link
Owner

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() and showActionPanel() methods
  • HighlighterFactory class for creating highlighter instances based on language
  • CodeBlockWrapper class for separating presentation logic from highlighting
  • LanguageNormalizer class 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 HighlighterBase an abstract class (cannot be instantiated directly)
  • BREAKING: Added ext-dom PHP extension requirement (previously optional with regex fallback)
  • Improved HTML attribute parsing using DOMDocument with 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

@demyanovs demyanovs merged commit 6717cba into master Nov 21, 2025
4 checks passed
@demyanovs demyanovs deleted the release-v3.0.0 branch November 21, 2025 15:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants