This repository was archived by the owner on Nov 29, 2022. It is now read-only.
Change "url" function to avoid anchor links #62
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hi Buffer Team,
This is just a quick update/suggestion that could help publishers to share the correct link, removing possibles anchors from the URL.
The function is the same as "window.location.href", but will stripe all the anchor tags ("example.com/page.html#anchor" is converted to "example.com/page.html" )
This way is removed any anchor text from the link, that could have impact in the sharing (for instance, on Facebook Pages with Instant articles, where a link with and without anchor text is marked as "different") or that can lead the users to "jump" in the page without being that what the publisher wants...
If needed, the link with anchor tags can still be shared manually by the user in the text area (this is just related with the "auto fetch" of the page link). Google Analytics tags are also not affected in any way for what i can see...
Probably there is other ways of do this. But this is the easy one and, probably, the one more "compatibility safe".
Keep going with the great work!