question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Link to External Pages with Anchor Elements test is too permissive

See original GitHub issue

Describe your problem and how to reproduce it: the challenge can be passed with an url like href="https://freecatphotoapp.com.", or href="https://freecatphotoapp.com/stuuyuuufushtfgh"

Add a Link to the page with the problem: https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/link-to-external-pages-with-anchor-elements

Suggestion:

-assert(/https:\/\/(www\.)?freecatphotoapp\.com/gi.test($('a').attr('href')));
+assert(/^https:\/\/(www\.)?freecatphotoapp\.com$/i.test($('a').attr('href')));
  • add anchors to make sure that the link is exactly that with no extra stuff around
  • remove the g tag which in this case is just useless
  • ~[possibly] add the possibility to have an http link pass, seeing that the video hint show that link (it shows an example https, and then it deletes the s)~

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
naomi-lgbtcommented, Feb 18, 2021

[possibly] add the possibility to have an http link pass, seeing that the video hint show that link (it shows an example https, and then it deletes the s)

I’d vote against this one, personally. The http vs https often trips up campers, but I think that’s an important bit that calls attention to the fact that the protocol matters.

add anchors to make sure that the link is exactly that with no extra stuff around remove the g tag which in this case is just useless

These I very much agree with and, provided no one disagrees, would gladly open this up to contributions.

0reactions
naomi-lgbtcommented, Feb 19, 2021

An issue with the help wanted or first timers only label is open for contribution. The first comprehensive PR created will be reviewed and merged. We typically do not assign issues to anyone other than long-time contributors.

If you would like to contribute, and have not read the contributors docs, please do so here: https://contribute.freecodecamp.org/#/

If you have any issues with contributing, be sure to join us on the contributors channel, or on the contributors sub-forum

Read more comments on GitHub >

github_iconTop Results From Across the Web

Link to External Pages with Anchor Elements (anchor)
Question: Your a element should have the anchor text of “cat photos”. Thank you. I had some issues on it too.
Read more >
Link to External Pages with Anchor Elements Free ... - YouTube
... LINK : https://www.freecodecamp.org/learn/responsive-web-design/basic-html-and-html5/ link-to-external - pages-with-anchor -elementsCheck out ...
Read more >
Link to External pages with Anchor Elements | freeCodeCamp
Linking to external pages is accomplished in HTML using an anchor text. In this tutorial, we use anchor text to link a few...
Read more >
Link to External Pages with Anchor Elements, freeCodeCamp ...
In this challenge we learn how to link to external pages using anchor elements. Anchor elements are usually those clickable words on a...
Read more >
jdk8/jdk8/langtools: 933ba3f81a87
+ * + * @param sectionName the section name anchor attribute for page + ... or interface in java.math\"><code>Link to external member gcd</code></a>"}, ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found