Skip to content

Commit c4bf5dd

Browse files
Simplify link regex capture groups
1 parent 5d26aba commit c4bf5dd

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

index.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -593,7 +593,7 @@ exports.astNodeVisitor = {
593593
replace(typeRegex);
594594

595595
const linkWithoutTextRegex = new RegExp(
596-
`@(link (?!https?))${key}(\\.[^\\s\\}]*)*(\\s*\\})`,
596+
`@(link (?!https?))${key}((?:\\.[^\\s\\}]*)*\\s*\\})`,
597597
'g',
598598
);
599599
const linkWithTextRegex = new RegExp(
@@ -604,7 +604,7 @@ exports.astNodeVisitor = {
604604
// If link is without text, use key as text
605605
comment.value = comment.value.replace(
606606
linkWithoutTextRegex,
607-
`@$1${key} ${key}$2$3`,
607+
`@$1${key} ${key}$2`,
608608
);
609609

610610
replace(linkWithTextRegex);

0 commit comments

Comments
 (0)