Skip to content

Commit f8b265d

Browse files
committed
Little fix for revision link
1 parent 57b37e6 commit f8b265d

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

web/src/utils/general.ts

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -260,12 +260,12 @@ export function renderRevisionLink(versionRaw: string) {
260260
matchedText = matchR[0];
261261
}
262262

263-
// Case 2: versions like 1.5.5-9.13999 → take last .number
263+
// Case 2: versions like X.Y.Z-*.NNNNN (revision only if after a dash)
264264
if (!revisionNumber) {
265-
const matchVersion = versionRaw.match(/(\d+)(?!.*\d)/);
266-
if (matchVersion) {
267-
revisionNumber = matchVersion[1];
268-
matchedText = matchVersion[0];
265+
const matchDash = versionRaw.match(/-(?:\d+\.)+(\d+)$/);
266+
if (matchDash) {
267+
revisionNumber = matchDash[1];
268+
matchedText = matchDash[1];
269269
}
270270
}
271271

0 commit comments

Comments
 (0)