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.

url regex is replacing & with &; breaking urls

See original GitHub issue

Similar to #803 I haven’t looked at the code, but see this url in the review section:
https://github.com/saglacio/saglac.io/pull/143/files/e92bf806d0a0757da2b16623172fa3041e65db36#diff-aeb42283af8ef8e9da40ededd3ae2ab2R23

And the same url not being transformed to a js-linkable-line-number in the conversation:
https://github.com/saglacio/saglac.io/pull/143#discussion-diff-150555564L22

Original (screenshot):

Bug (screenshot, notice the missing amp at the end of the link):

Live test:

url: https://saglac.us17.list-manage.com/subscribe/post?u=c9f3c71f1370a7e550caa409b&id=f45e751233

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:1
  • Comments:6 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
fregantecommented, Jan 16, 2018

For a moment I thought this was an enhancement, but it really is a bug. Not only the URL is linkified incorrectly (oh well…), but the code is also changed (which should never happen, amp should not be missing)

This bug can be fixed here: https://github.com/sindresorhus/linkify-urls/issues/14

0reactions
fregantecommented, Dec 8, 2017

Perhaps & is common enough to grant its own simple detection+unescaping though.

It’s not a valid URL until you unescape it. It’s common to find them in HTML documents.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Getting parts of a URL (Regex) - Stack Overflow
A single regex to parse and breakup a full URL including query parameters and anchors e.g..
Read more >
AMP Version Redirects - WordPress.org
Hello,. the AMP Version URL of my website has changed from /amp/ to /?amp for all Pages, Categories, Posts etc. Is there a...
Read more >
Google AMP Case Study - Leads Dropped by 59% (How to ...
Click on the box next to “RegEx” and then click on “Update Settings.” This will replace/remove that important AMP tag as Google recommends ......
Read more >
How to move from m-dot URLs to responsive site
Here are some recommendations on how to move from separate urls to one responsive URL in a way that gives your sites the...
Read more >
Transfer UTM Parameters From One Page To Another with GTM
If the URLs that you wish to decorate already contain query (a.k.a. URL) parameters from the Custom HTML tag, they will not be...
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