Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(w3c/linter): implement alt to CSS :scope (fixes #1314) #1316

Merged
merged 1 commit into from Jul 10, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 4 additions & 7 deletions src/w3c/linter.js
Expand Up @@ -34,14 +34,11 @@ function findHTTPProps(conf, base) {
}

function findHeadinglessSections(doc) {
return Array.from(doc.querySelectorAll("section:not(#toc)")).filter(function(
elem
) {
return (
elem.querySelector(
":scope>h2, :scope>h3, :scope>h4, :scope>h5, :scope>h6"
) === null
return Array.from(doc.querySelectorAll("section:not(#toc)")).filter(elem => {
const heading = elem.querySelector(
"h2:first-child, h3:first-child, h4:first-child, h5:first-child, h6:first-child"
);
return heading && heading.parentElement !== elem;
});
}

Expand Down