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
Mark font server URLs as not intended to work #10645
Mark font server URLs as not intended to work #10645
Conversation
build-system/tasks/check-links.js
Outdated
@@ -137,6 +137,10 @@ function filterWhitelistedLinks(markdown) { | |||
// Dailymotion link that is marked dead in Travis CI | |||
filteredMarkdown = filteredMarkdown.replace(/https:\/\/developer.dailymotion.com\/player#player-parameters/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While you're making this change, would you mind breaking this long line into two by adding a new line after replace(
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sure thing!
Which do you prefer?
filteredMarkdown = filteredMarkdown.replace(
/https:\/\/developer.dailymotion.com\/player#player-parameters/g,'');
or (more consistent)
filteredMarkdown = filteredMarkdown.replace(
/https:\/\/developer.dailymotion.com\/player#player-parameters/g,
''
);
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated with the first option.
a1c1762
to
c0668af
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Undoing my approval, with some new info. Let me know what you think. I'm happy to defer the final decision to you and / or @pbakaus
build-system/tasks/check-links.js
Outdated
@@ -135,7 +135,12 @@ function filterWhitelistedLinks(markdown) { | |||
filteredMarkdown = filteredMarkdown.replace(/<code>(.*?)<\/code>/g, ''); | |||
|
|||
// Dailymotion link that is marked dead in Travis CI | |||
filteredMarkdown = filteredMarkdown.replace(/https:\/\/developer.dailymotion.com\/player#player-parameters/g, ''); | |||
filteredMarkdown = filteredMarkdown.replace( | |||
/https:\/\/developer.dailymotion.com\/player#player-parameters/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for doing this. For line continuations, we need 4 spaces of indent.
build-system/tasks/check-links.js
Outdated
|
||
// Font providers CDNs that return 404 on the root | ||
filteredMarkdown = filteredMarkdown.replace(/https:\/\/fast.fonts.net/g, ''); | ||
filteredMarkdown = filteredMarkdown.replace(/https:\/\/fonts.googleapis.com/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just thought about this further, and there is precedent for wrapping links that are not supposed to work within backticks. See #10585 (comment) for a discussion on this. (cc @pbakaus)
If you want a uniform look across all three links listed in this section, may I suggest that you put all of them within backticks, since they are origins and not actual URLs that need to be clicked?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
+1. Let's not format things as clickable URLs that aren't actually targets. I therefore think we shouldn't whitelist them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No problem, I wasn't sure what is the better solution :)
Thanks for comments!
c0668af
to
1bd8f59
Compare
build-system/tasks/check-links.js
Outdated
@@ -135,7 +135,12 @@ function filterWhitelistedLinks(markdown) { | |||
filteredMarkdown = filteredMarkdown.replace(/<code>(.*?)<\/code>/g, ''); | |||
|
|||
// Dailymotion link that is marked dead in Travis CI | |||
filteredMarkdown = filteredMarkdown.replace(/https:\/\/developer.dailymotion.com\/player#player-parameters/g, ''); | |||
filteredMarkdown = filteredMarkdown.replace( | |||
/https:\/\/developer.dailymotion.com\/player#player-parameters/g, ''); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit unrelated to this PR in particular (issue existed before): Any reason why we're not escaping dots? These would match stuff like "https://fast fonts net".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it is an oversight. Fixed it in the whole file.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
great thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, this was an oversight on my part when I first wrote the link checker. Thanks for fixing.
1bd8f59
to
8b235a0
Compare
@rsimha-amp, @pbakaus please re-review :) |
Thanks @robinpokorny for making the changes, and @pbakaus for reviewing. |
When changing
spec/amp-html-format.md
Trevis fails duringcheck-links
task. For example here: https://travis-ci.org/ampproject/amphtml/jobs/257735944#L757These two font providers do not implement the root page and return 404 error.
Changes: All three font provider URLs are made non-clickable. Small improvements in
check-links
task.Related-to #10644