Skip to content

chore: fix and improve FeedbackWidget removal regex #2151

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions apps/base-docs/scripts/remove-feedback.ts
Original file line number Diff line number Diff line change
@@ -12,10 +12,10 @@ async function removeFeedbackWidget(file: string) {
}

// Remove the import statement
content = content.replace(/import\s*{\s*FeedbackWidget\s*}\s*from\s*['"].*?['"]\s*\n?/g, '')
content = content.replace(/import\s+{[^}]*\bFeedbackWidget\b[^}]*}\s+from\s+['"][^'"]+['"];\s*\n?/g, '')

// Remove the FeedbackWidget component
content = content.replace(/<FeedbackWidget\s*\/>\s*\n?/g, '')
content = content.replace(/<FeedbackWidget\b[^>]*\/>\s*\n?/g, '')

// Clean up any double newlines that might have been created
content = content.replace(/\n{3,}/g, '\n\n')
@@ -54,4 +54,4 @@ async function main() {
}
}

main()
main()