How bonmercato/htmlfixinator works
Main Components
a) Core Components:
• Filter Registry/Factory
• HTML Parser/Serializer Interface
• Filter Chain Orchestrator
• Individual Filter Implementations
b) Filter Components (represent each as a separate module):
• AttributeFilter
• CommentFilter
• ElementFilter
• EmptyFilter
• RelativeToAbsoluteFilter (RelAbs)
• NoopFilter (utility filter)
Top Level (Public API):
• string_to_node()
• node_to_string()
• Filter Factory
• FilterChain Builder
Middle Level (Filter Infrastructure):
• FilterTrait Implementation
• Chain Processing Logic
• Filter Registry
Bottom Level (Individual Filters):
• All concrete filter implementations
Component Relationships
• How the FilterChain orchestrates multiple filters
• Filter pipeline flow from input HTML to output HTML
• Demonstrate how each filter implements the FilterTrait
• Relationship between string conversion utilities and the filter system
Specific Design Elements
Use these visual elements:
• Blue rectangles for core components
• Green rectangles for individual filters
• Yellow diamonds for interfaces/traits
Key Architectural Patterns to Highlight
• Chain of Responsibility Pattern (for filter chain)
• Strategy Pattern (for individual filters)
• Builder Pattern (for filter chain construction)
• Factory Pattern (for filter creation)
Detailed Component Specifications
Input/Output Layer:
• HTML String Input
• DOM Node Conversion
• Filter Application
• HTML String Output
Filter Infrastructure:
• FilterTrait (interface)
• FilterChain (compositor)
• Filter Factory (creation)
Individual Filters:
• Each filter with its specific transformation logic
• Filter-specific configuration options
Implementation Details
• How filters can be composed using the chain
• Error handling paths
• Optional filter configurations
• Transformation pipeline flow
Notes
• Keep the focus on the filter system architecture
• Extensibility points for new filters
• Public API surface
• Thread-safety boundaries