Documentation ¶
Overview ¶
Package htmlproc implements a Processor to process HTML documents.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewHTMLProcessor ¶
NewHTMLProcessor creates and initializes a new Processor to process HTML documents. The Processor turns provided exchange.Response into htmldoc.HTMLResponse then runs the specified htmltask.HTMLTasks one by one. The Processor fails immediately when some HTMLTask encounters an error.
Types ¶
type Config ¶
type Config struct { // TaskSet specifies the sequence of HTMLTasks to run. // // nil or empty implies htmltask.ConservativeTaskSet. TaskSet []htmltask.HTMLTask // ModifyHTML indicates whether the processor can modify HTML documents. // // When ModifyHTML is true, the processor always rewrites the payload // with HTML reconstructed from the parse tree. The response thus always // contains a well-formed HTML after processing. // // Some HTMLTasks have an effect only when ModifyHTML is true. ModifyHTML bool }
Config holds parameters to NewHTMLProcessor.
Directories ¶
Path | Synopsis |
---|---|
Package htmldoc provides interface to handle HTML documents.
|
Package htmldoc provides interface to handle HTML documents. |
Package htmltask implements some optimization logic for HTML documents.
|
Package htmltask implements some optimization logic for HTML documents. |
Click to show internal directories.
Click to hide internal directories.