fixup d660e6bd: off-by-1 in parseStringUnquoted

This commit is contained in:
tophf 2017-12-01 00:23:06 +03:00
parent 71f3dfbffd
commit 9c3229717f

View File

@ -252,7 +252,7 @@ var usercss = (() => {
function parseStringUnquoted(state) {
const pos = state.re.lastIndex;
const nextQuoteOrEOL = posOrEnd(state.text, '"', pos);
state.re.lastIndex = Math.max(0, nextQuoteOrEOL - 1);
state.re.lastIndex = nextQuoteOrEOL;
state.value = state.text.slice(pos, nextQuoteOrEOL).trim().replace(/\s+/g, '-');
}