Fix additional links being shown with an empty #35
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.com
instead 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
strpos
result 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.