Skip to content

Commit 3dbec81

Browse files
committed
Fix changeset linking when preceded by @-mention
Add a negative lookbehind group to the CHANGESET_LINKING_REGEX, ensuring that the pattern is preceded by whitespace or the beginning of the string. Fixes #204
1 parent ef84508 commit 3dbec81

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Source/Source.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class SourcePlugin extends MantisSourceBase {
2424
* <rev> = changeset revision ID (e.g. SVN rev number, GIT SHA, etc.)
2525
* The match is not case-sensitive.
2626
*/
27-
const CHANGESET_LINKING_REGEX = '/(?:([cdsvp]?):([^:\s][^:\n\t]*):([^:\s]+):)/i';
27+
const CHANGESET_LINKING_REGEX = '/(?:(?<=^|\s)([cdsvp]?):([^:\s][^:\n\t]*):([^:\s]+):)/i';
2828

2929
function register() {
3030
$this->name = plugin_lang_get( 'title' );

0 commit comments

Comments
 (0)