My goal is to use Greasemonkey to link Redmine issue numbers found in cgit commit messages to their respective issues or projects.
The cgit commit message HTML source looks like this:
<a href='/editingmodule/commit/?id=49e4a33e0f8b306ded5'>refs #459 - create separate directory and repo for editingModule, lots of dif...</a>
What I aim to achieve is to turn the #459 into a separate hyperlink leading to the Redmine issue, while keeping the cgit links intact on either side. This means transforming the URL above to:
<a href='/editingmodule/commit/?id=49e4a33e0f8b306ded5'>refs</a>
<a href='http://redmine.project.com/redmine/issues/459'>#459</a>
<a href='/editingmodule/commit/?id=49e4a33e0f8b306ded5'> - create separate directory and repo for editingModule, lots of dif...</a>
Although it may seem complicated, the #459 in the link above is now connected to the Redmine project.
For clarity, the Redmine issue link can also be added to the cgit link.