On this page

class HtmlParser extends Parser
Source Code: lib/html/HtmlParser.js#L693
new HtmlParser(): HtmlParser
Returns:HtmlParser
Source Code: lib/html/HtmlParser.js#L713
Type:string
Source Code: lib/html/HtmlParser.js#L700
Type:Context
Source Code: lib/html/HtmlParser.js#L720
htmlParser.template(source, context): string
Source Code: lib/html/HtmlParser.js#L704
Attributes
source:string
Returns:string
htmlParser.applyTemplate(source, module): string | Buffer<ArrayBufferLike>
Source Code: lib/html/HtmlParser.js#L785
Attributes
source:string | Buffer<ArrayBufferLike>
Returns:string | Buffer<ArrayBufferLike>

Runs the template option over the source and returns the transformed html. Called from HtmlModulesPlugin's processResult, where the return value becomes the module's stored source so the parser (which records dependency offsets against it) and the generator (which renders from module.originalSource()) stay in agreement.

htmlParser.parse(source, state): ParserState
Source Code: lib/Parser.js#L35
Attributes
source:string | Buffer<ArrayBufferLike> | PreparsedAst
Returns:ParserState

Parses the provided source and updates the parser state.