Skip to content

Commit

Permalink
Simplify regex per Phils advice
Browse files Browse the repository at this point in the history
  • Loading branch information
john-rock committed May 12, 2022
1 parent fa4f15d commit 08695e6
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions website/src/components/faqs/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,9 @@ function FAQ({children, src, alt_header=null}) {

// If faqFile found with ID, set filePath for this file
if(faqFile?.id) {
const data = faqFile.filePath.match(/(?:docs\/faqs\/)(.*)(?=.md)/g)
const data = faqFile.filePath.match(/(docs\/faqs\/(.*)\.md$)/g)
if(data?.length) {
setFilePath(data[0])
setFilePath(data[1])
}
}
}, [])
Expand Down

0 comments on commit 08695e6

Please sign in to comment.