aboutsummaryrefslogtreecommitdiffstats
path: root/src/selector/var/attributes.js
blob: f9813acec26acaa27665627b146ca556f0c3fbe4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
import whitespace from "../../var/whitespace.js";
import identifier from "./identifier.js";

// Attribute selectors: https://www.w3.org/TR/selectors/#attribute-selectors
export default "\\[" + whitespace + "*(" + identifier + ")(?:" + whitespace +

	// Operator (capture 2)
	"*([*^$|!~]?=)" + whitespace +

	// "Attribute values must be CSS identifiers [capture 5] or strings [capture 3 or capture 4]"
	"*(?:'((?:\\\\.|[^\\\\'])*)'|\"((?:\\\\.|[^\\\\\"])*)\"|(" + identifier + "))|)" +
	whitespace + "*\\]";