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

chore(gatsby-source-wordpress): Test html link transforms #29942

Merged
merged 4 commits into from
Mar 3, 2021

Conversation

TylerBarnes
Copy link
Contributor

@TylerBarnes TylerBarnes commented Mar 2, 2021

This PR adds a test for html field link transforms (from absolute urls to relative paths).

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Mar 2, 2021
@TylerBarnes TylerBarnes added topic: source-wordpress Related to Gatsby's integration with WordPress and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Mar 2, 2021
Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! I would want to advise moving away from execall to match-all https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/matchAll

Copy link
Contributor

@wardpeet wardpeet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this need to be backported?

@TylerBarnes
Copy link
Contributor Author

@wardpeet my understanding is that tests aren't running as part of the backporting process. When I tagged the integration tests as needing backporting Matt mentioned they don't need to be backported.

@TylerBarnes TylerBarnes merged commit 8d82a20 into master Mar 3, 2021
@TylerBarnes TylerBarnes deleted the feat/wp-test-html-link-matches branch March 3, 2021 16:43
@wardpeet
Copy link
Contributor

wardpeet commented Mar 3, 2021

I thought you created a function to mitigate a bug, that's all :)

@TylerBarnes
Copy link
Contributor Author

Ahh, got it! I created the function to make the regexp testable 👍 thanks for checking :)

@wardpeet
Copy link
Contributor

wardpeet commented Mar 3, 2021

Because regexes are stateful in javascript - that's why I was thinking that 😄
https://javascript.plainenglish.io/most-surprising-behavior-of-javascript-regular-expression-you-have-ever-seen-1ddb84539163

@TylerBarnes
Copy link
Contributor Author

Interesting! I didn't know that - thanks for the link

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: source-wordpress Related to Gatsby's integration with WordPress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants