Skip to content

Commit fbaa4ad

Browse files
author
Wolfram Nikolas Müller
committed
Change CLASS_NAME_PATTERN to work also for haml templates
1 parent 2338bd6 commit fbaa4ad

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/tailwindcss/purger.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# frozen_string_literal: true
22

33
class Tailwindcss::Purger
4-
CLASS_NAME_PATTERN = /[:A-Za-z0-9_-]+[\.]*[\\\/:A-Za-z0-9_-]*/
4+
CLASS_NAME_PATTERN = /((?:[:A-Za-z0-9_-]+[\\\/:A-Za-z0-9_-]*[0-3][\\.]*5)|(?:[A-Za-z0-9_-]+[\\\/:A-Za-z0-9_-]*))/
55

66
CLASS_BREAK = /(?![-_a-z0-9\\])/i # `\b` for class selectors
77

@@ -29,7 +29,7 @@ def purge(input, keeping_class_names_from_files:)
2929
end
3030

3131
def extract_class_names(string)
32-
string.scan(CLASS_NAME_PATTERN).uniq.sort!
32+
string.scan(CLASS_NAME_PATTERN).flatten.uniq.sort!
3333
end
3434

3535
def extract_class_names_from(files)

0 commit comments

Comments
 (0)