diff --git a/CHANGELOG.md b/CHANGELOG.md index bbe8c35dbcae..521b39bba276 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] -- Nothing yet! +### Fixed + +- Fix candidate extractor regression ([#8558](https://github.com/tailwindlabs/tailwindcss/pull/8558)) ## [3.1.0] - 2022-06-08 diff --git a/src/lib/defaultExtractor.js b/src/lib/defaultExtractor.js index 973250ea4d5a..98bc7386baca 100644 --- a/src/lib/defaultExtractor.js +++ b/src/lib/defaultExtractor.js @@ -43,7 +43,7 @@ function* buildRegExps(context) { /(?![{([]])/, // optionally followed by an opacity modifier - /(?:\/[^\s'"\\$]*)?/, + /(?:\/[^\s'"\\><$]*)?/, ]), regex.pattern([ @@ -58,7 +58,7 @@ function* buildRegExps(context) { ]), // Normal values w/o quotes — may include an opacity modifier - /[-\/][^\s'"\\$={]*/, + /[-\/][^\s'"\\$={><]*/, ]) ), ]), diff --git a/tests/default-extractor.test.js b/tests/default-extractor.test.js index 789f2eb5d685..4e1792e8e7b9 100644 --- a/tests/default-extractor.test.js +++ b/tests/default-extractor.test.js @@ -438,3 +438,14 @@ test('with double quotes array within function', async () => { expect(extractions).toContain('pl-1.5') expect(extractions).not.toContain('pl-1') }) + +test('with angle brackets', async () => { + const extractions = defaultExtractor( + `
test
` + ) + + expect(extractions).toContain('bg-blue-200') + expect(extractions).toContain('shadow-xl') + expect(extractions).not.toContain('>shadow-xl') + expect(extractions).not.toContain('shadow-xl<') +})