Skip to content

Commit 997786d

Browse files
committed
Fix regex to ignore variables on web names. Fixes #90
1 parent d38ac39 commit 997786d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

line.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ def color(self):
204204
def generate_webcolors(self):
205205
"""Generates a list of web color names."""
206206
self.WEB_COLORS = dict((name, color) for (name, color) in css3_names_to_hex.items())
207-
self.WEB_COLORS_REGEX = "("+ "|".join(self.WEB_COLORS.keys()) +")"
207+
self.WEB_COLORS_REGEX = '((?<!\$)'+ '|(?<!\$)'.join(self.WEB_COLORS.keys()) +')'
208208

209209
def web_color(self):
210210
"""Returns the color in the line, if any CSS color name is found."""

0 commit comments

Comments
 (0)