Skip to content

Commit 5ad5158

Browse files
committed
support more pseudoclasses
1 parent 0071a20 commit 5ad5158

File tree

8 files changed

+1440
-139
lines changed

8 files changed

+1440
-139
lines changed

package.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
"name": "css-coverage",
33
"version": "1.2.2",
44
"scripts": {
5+
"pretest": "sass --source-map ./test/test.scss ./test/test.css",
56
"test": "./bin/css-coverage.js --cover-declarations --html ./test/test.html --css ./test/test.css --lcov ./test/test.lcov",
67
"test-debug": "node --inspect-brk ./bin/css-coverage.js --cover-declarations --html ./test/test.html --css ./test/test.css --lcov ./test/test.lcov",
78
"posttest": "standard --fix"
@@ -30,5 +31,8 @@
3031
"main": "index.js",
3132
"repository": "https://github.com/openstax/css-coverage.js.git",
3233
"author": "Philip Schatz <phil@cnx.org>",
33-
"license": "MIT"
34+
"license": "MIT",
35+
"devDependencies": {
36+
"sass": "^1.17.0"
37+
}
3438
}

src/runCoverage.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,7 @@ async function runCoverage () {
158158
const rules = cssRules
159159

160160
// Add default do-nothing for selectors used in cnx-easybake
161-
const PSEUDOS = ['deferred', 'pass', 'match', 'after', 'before', 'outside']
161+
const PSEUDOS = ['deferred', 'pass', 'match', 'after', 'before', 'outside', 'link', 'footnote-call', 'footnote-marker']
162162
PSEUDOS.forEach(function (pseudo) {
163163
window.Sizzle.selectors.match[pseudo] = RegExp(':?:?' + pseudo)
164164
window.Sizzle.selectors.find[pseudo] = function (match, context, isXML) { return context }

test/test.css

Lines changed: 44 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test.css.map

Lines changed: 1 addition & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

test/test.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ <h1>Simple test file with 2 classes</h1>
44
<div class="class1">Hello</div>
55
<div class="class2">World</div>
66
<div class="footer">And a little footer</div>
7+
<a href="#id123">a:link</a>
78
<hr/>
89
</body>
910
</html>

0 commit comments

Comments
 (0)