makestatic-parse-html v1.1.16
Parse HTML
Parse HTML files to an AST
Parses HTML output files to an abstract syntax tree.
Install
yarn add makestatic-parse-htmlAPI
ParseHtml
Parses HTML files to abstract syntax trees.
See Also
.sources
ParseHtml.prototype.sources(file, context[, options])Parse a file to an abstract syntax tree, the AST is assigned to
file.ast.html.
This implementation assigns a seal function to the file so that when
the file content is updated it will correspond to the current state of
the AST.
The generated AST is decorated with querySelector and querySelectorAll
functions so that you can query the AST for desired nodes.
It also adds an adapter getter that allows access to the static DOM
adapter function.
fileObject the current file.contextObject the processing context.optionsObject options forpostcss.
#getAttribute
static getAttribute(el, name[, value])Utility to get an attribute from a node.
Iterates the attribute list and gets the first attribute that has the given name and optionally a specific value.
Note this is an extension to the interface required by css-select.
Returns the attribute or undefined.
elObject the node.nameString the attribute name.valueString the attribute value.
License
MIT
Created by mkdoc on March 12, 2017
8 years ago
8 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago
9 years ago