Skip to content
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

🐛 tighten gdoc regex to not match on sheets links #2687

Merged
merged 2 commits into from
Oct 2, 2023

Conversation

ikesau
Copy link
Member

@ikesau ikesau commented Oct 2, 2023

This RegEx was catching a spreadsheet link Hannah had included in the article on deforestation and causing Gdoc validation to complain about linking to an article that hadn't been registered.

This PR updates the RegEx to require the /document/ resource be specified, and uses a more specific non-capturing group to handle the optional google account information that may be contained in the link.

To test, I extracted all the docs.google.com URLs we have in prod and ran them on regex101.com. The spreadsheet URL was the only one that didn't match.

And here is the link working correctly now:

image

@ikesau ikesau requested a review from marcelgerber October 2, 2023 14:16
@ikesau ikesau self-assigned this Oct 2, 2023
@ikesau ikesau force-pushed the fix-docs-sheets-regex branch from 1805f25 to 3f670a7 Compare October 2, 2023 14:20
@ikesau ikesau merged commit 6177c0e into master Oct 2, 2023
13 checks passed
@ikesau ikesau deleted the fix-docs-sheets-regex branch October 2, 2023 14:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants