mirror of https://github.com/gorhill/uBlock.git
Fix dealing with trailing newline characters
Regression from:
- 01b1ed9a98
The new parser needs to be able to deal with trailing
newline characters, which if present will be interpreted
as trailing spaces.
This commit is contained in:
parent
cef034f650
commit
6633e2635d
|
@ -1000,10 +1000,17 @@ const BITHostname = BITNum | BITAlpha | BITUppercase | BITDash | BITPeriod
|
|||
const BITPatternToken = BITNum | BITAlpha | BITPercent;
|
||||
const BITLineComment = BITExclamation | BITHash | BITSquareBracket;
|
||||
|
||||
// Important: it is expected that lines passed to the parser have been
|
||||
// trimmed of new line characters. Given this, any newline characters found
|
||||
// will be interpreted as normal white spaces.
|
||||
|
||||
const charDescBits = [
|
||||
/* 0x00 - 0x08 */ 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x09 */ BITSpace,
|
||||
/* 0x0A - 0x0F */ 0, 0, 0, 0, 0, 0,
|
||||
/* 0x09 */ BITSpace, // \t
|
||||
/* 0x0A */ BITSpace, // \n
|
||||
/* 0x0B - 0x0C */ 0, 0,
|
||||
/* 0x0D */ BITSpace, // \r
|
||||
/* 0x0E - 0x0F */ 0, 0,
|
||||
/* 0x10 - 0x1F */ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
/* 0x20 */ BITSpace,
|
||||
/* 0x21 ! */ BITExclamation,
|
||||
|
|
Loading…
Reference in New Issue