Auto-linking is not correctly applied to links in diffs
See original GitHub issueRef: https://github.com/Homebrew/homebrew-core/pull/18015/files
url "https://github.com/mholt/caddy/archive/v0.10.9.tar.gz"
Issue Analytics
- State:
- Created 6 years ago
- Reactions:1
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Autolinking broken in 0.69 · Issue #2267 · getsentry ... - GitHub
I guess the CLI does not properly looks up its arguments, and as it is wrapped by with-environment.sh it tries to parse sentry-cli...
Read more >html - How to control what Gmail auto-linking recognizes as an ...
I'm having inconsistent/buggy issues when delivering transactional emails (in this example, purchase confirmation email) to clients. Gmail not ...
Read more >plugin:autolink4:differences [DokuWiki]
The first autolink is a script which searches your wiki, and replaces text strings with links. Pros. Maximum performance: Since there's no ......
Read more >Linking - Expo Documentation
Learn how to use Linking to handle a URL based on the URL scheme. ... The following is a non-exhaustive list, but covers...
Read more >The Current State of Telephone Links | CSS-Tricks
For example, many devices will automagically recognize phone numbers and do the linking for us, but not always.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Thinking out loud. Discarding tags while parsing the URLs and preserving them in the output is a pain, especially if they need to be split (e.g. half linked, half not linked)
So here’s a possible solution, drawn. This shows the old, line-by-line parsing (instead of textnode-by-textnode). It pushed a flat text for each line
linkifyUrls(line.textContent)
, therefore initially discarding all extra elements in the line.Legend:
-
is a URL that should be linked#
is an element in the URL, like a<span class="x">
for diffsA
is a linked URL, like<a href="----------">
How do we merge the two?
Character data has not been changed, so it can somehow zipped together.
The question now is: how do we zip them?
input
element, where N is the first non-linked characters in the output.output
fragment.This is the API:
Selection.prototype.modify('extend', 'forward', 'character')
. DemoEdit: I’ve done this “zipping” in another project. Ping me if anyone’s interested.
Edit: a year later, here it is: https://github.com/bfred-it/zip-text-nodes
I think it isn’t picking up anything after “10.” because the whole url isn’t in the same element. since you edited part of the url, GitHub adds the ‘x’ class to it giving it the green background colour to show code addition
The same link is working in the original file here
Here is how the css looks like on original GitHub when you change something in the url
If the Url isn’t changed, this is the css that is rendered