Security News
New Python Packaging Proposal Aims to Solve Phantom Dependency Problem with SBOMs
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
html-structure-linter
Advanced tools
[![npm version](https://badge.fury.io/js/html-structure-linter.svg)](https://badge.fury.io/js/html-structure-linter) [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT) [![Build Status](https://github.com
Searches through a given list of html files for css selectors
One use case is to search for specific selectors inside one or multiple files
html-structure-linter "span > div" test/fixtures/demo.html
html-structure-linter "span > div" "test/**/*.html"
Result:
test/fixtures/demo.html contains 2 matches:
Selector "span > div"
8:12
You can pass a config to specify all selectors and messages you want to validate.
See the example config for details
html-structure-linter -c test/fixtures/example.config.json
Result:
test/fixtures/demo.html contains 1 match:
Selector "span div" - DIV in SPAN is not allowed in xhtml strict mode - see https://www.w3.org/2010/04/xhtml10-strict.html
8:12
1 file checked for 1 selector.
You can also use the library directly from node
import {getMatchingSelectors, fileResultToString} from 'html-structure-linter';
const exampleInput = '<div><span></span></div>';
const selectors = {
"span div": "DIV in SPAN is not allowed in xhtml strict mode - see https://www.w3.org/2010/04/xhtml10-strict.html"
};
const lintResult = getMatchingSelectors(exampleInput, selectors);
const lintText = fileResultToString(lintResult, selectors);
console.log(lintText);
You can also use a shorthand to lint a bunch of files:
import {validate} from 'html-structure-linter';
validate({
selectors: { "span div": "Div in Span not allowed" },
files: [
"**/*.html",
"!node_modules/**/*.*"
]
}).then(({ resultText, footer, hasMatches }) => {
console.log(resultText);
console.log(footer);
if (hasMatches) {
process.exit(1);
}
});
FAQs
[![npm version](https://badge.fury.io/js/html-structure-linter.svg)](https://badge.fury.io/js/html-structure-linter) [![License](https://img.shields.io/badge/license-MIT-green.svg)](http://opensource.org/licenses/MIT) [![Build Status](https://github.com
The npm package html-structure-linter receives a total of 1 weekly downloads. As such, html-structure-linter popularity was classified as not popular.
We found that html-structure-linter demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 7 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
PEP 770 proposes adding SBOM support to Python packages to improve transparency and catch hidden non-Python dependencies that security tools often miss.
Security News
Socket CEO Feross Aboukhadijeh discusses open source security challenges, including zero-day attacks and supply chain risks, on the Cyber Security Council podcast.
Security News
Research
Socket researchers uncover how threat actors weaponize Out-of-Band Application Security Testing (OAST) techniques across the npm, PyPI, and RubyGems ecosystems to exfiltrate sensitive data.