Convert absolute links to document embedded objects to raw content refs #50
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.
What this PR does / why we need it:
Links to embedded objects, such as images on GitHub like:
https://github.com/gardener/gardener/blob/v1.11.1/logo/gardener-large.png
get redirected tohttps://raw.githubusercontent.com
to get the raw content for the image to be embedded and that mostly doesn't work well with every non-gitHub environment. In addition documentation is written with all sorts of image reference links.Now, every blob link that is resolved as absolute on a document, will be rewritten for 'raw' content type link that GitHub resolves correctly to requests for raw content.
Raw https://raw.githubusercontent.com links like also rewritten to the match the same consistent pattern.
The github.ResourceLocator object is now able to resolve URLs for every GitHub object - code (tree|blob), wiki (page), releases, pull(s), issue(s) and raw.githubusercontent links.
Processed destinations in document links are now inspected more carefully and returned early without modifications if they cannot/should not be processed.
Failures to parse a GitHub URL are now reported as errors.
Release note: