Fix additional links being shown with an empty - #35
Open
sttz wants to merge 2 commits into
Open
Conversation
contain a subpath (e.g. domain.com instead of domain.com/path) on project pages. This brings the behaviour of additional links in project pages in line with the index page, which already uses "!== false" instead of "!== 0".
parse out the domain, use the full result of parseLink as title by default and provide the option override the title in the xml using the linktitle field.
Author
|
I went ahead and implemented my suggestion as well. Now the link title is the output of |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
In project pages, additional links that don't contain a subpath (e.g.
domain.cominstead ofdomain.com/path) are shown with an empty title, i.e. not appearing at all in the rendered page.The behavior of the code for additional links is also not in sync between the index page and project pages. The index pages compares the
strposresult to!== false(does not contain) whereas the project page compares it to!== 0(does not begin with), which causes the issue.This pull requests fixes the issue and brings the behavior on the main page and project pages in line, always checking if the link contains a
/.I'm not sure if the behavior of this title-parsing is very useful anyway. I think it would be clearer to always show the link as it was entered and provide an optional title field in the xml to set the title manually.