feat: Override link text for code blocks #882
Open
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.
This is a proposed fix for #801.
I have made this PR because #820 seems to have been abandoned.
There is a difference in implementation with my PR, though.
Instead of providing another way to specify the URL, this PR proposes to allow writers to override the link text.
Why implement it this way?
By providing a new option called
full_urlyou are giving people another unrelated way of creating URLs that is not compatible with the current way. This may lead to unexpected behaviour (e.g. what should happen if abase_urlandfull_urlare specified?). Additionally, since it would be adding a new way of creating URLs, the logic to implement it is messier.With the
name_overrideway, we are not introducing a new way of specifying URLs. We are instead just allowing people to override the text of the generated URL with another string.With this method the URL will ALWAYS be generated with
base_url+filename.With the change being the link text is
named_override | default filenameI feel like this is a bit cleaner both in terms of expectations from the user, and from an implementation perspective.