Skip to content

Commit

Permalink
manually escape () and [] characters in globs
Browse files Browse the repository at this point in the history
  • Loading branch information
RobinMalfait committed Jan 5, 2024
1 parent 0a9a785 commit 174f93f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lib/content.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,6 +142,10 @@ export function parseCandidateFiles(context, tailwindConfig) {
* @returns {ContentPath}
*/
function parseFilePath(filePath, ignore) {
// Escape special characters in the file path such as: ()[]
// But only if the special character isn't already escaped
filePath = filePath.replace(/(?<!\\)([\[\]\(\)])/g, '\\$1')

let contentPath = {
original: filePath,
base: filePath,
Expand Down

0 comments on commit 174f93f

Please sign in to comment.