#1482 Adjust the markdown processor to have 1 regex for all cross-project links
Merged by pingou. Opened by pingou.
fix_regex_links  into  master

Download 1482.patch

Until now we had two regex/extensions for the cross-project links. One
for forks one for regular project but this lead to the situation where
if you have a pattern such as /# the first part
() would be linked to the fork of the project of that
user and the second part (#) would link to the ticket/PR
with this id in the original project.
That was because the regex for cross-link project was matching the
content of the link generated by the cross-link fork.
By moving to one regex for all, we fix this situation.

We're also adding unit-tests for this part of the code to help with
maintenance and stability.

rebased

rebased

not exactly related to this pr: why do we need the if statements here?

rebased

http://https://pagure.org/ doesn't seem right, does it?

Ah indeed, I fixed that in 1496, let me adjust it here as well

2 new commits added

  • Drop the protocol in the SERVER_NAME to avoid http://https://
  • Document the regex in a way that make the code compile and work

:thumbsup:

Thanks :)

Pull-Request has been merged by pingou

Metadata