mirror of
https://github.com/koalaman/shellcheck.git
synced 2025-08-07 17:14:13 +08:00
Warn when finding HTML entities like &
This commit is contained in:
@@ -1696,11 +1696,19 @@ readLineBreak = optional readNewlineList
|
||||
|
||||
prop_readSeparator1 = isWarning readScript "a &; b"
|
||||
prop_readSeparator2 = isOk readScript "a & b"
|
||||
prop_readSeparator3 = isWarning readScript "a & b"
|
||||
prop_readSeparator4 = isWarning readScript "a > file; b"
|
||||
readSeparatorOp = do
|
||||
notFollowedBy2 (void g_AND_IF <|> void readCaseSeparator)
|
||||
notFollowedBy2 (string "&>")
|
||||
f <- try (do
|
||||
pos <- getPosition
|
||||
char '&'
|
||||
optional $ do
|
||||
s <- lookAhead . choice . map (try . string) $
|
||||
["amp;", "gt;", "lt;"]
|
||||
parseProblemAt pos ErrorC 1109 "This is an unquoted HTML entity. Replace with corresponding character."
|
||||
|
||||
spacing
|
||||
pos <- getPosition
|
||||
char ';'
|
||||
|
Reference in New Issue
Block a user