Skip to content

Commit

Permalink
toh.js: slightly tune regex match for forum links
Browse files Browse the repository at this point in the history
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
  • Loading branch information
jow- committed Dec 6, 2023
1 parent b84d95c commit 4c0ff83
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion static/toh.js
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ function formatValue(colName, value) {
return formatLink(value, `Archive thread #${m[1]}`);
else if ((m = value.match(/\bviewtopic\.php\?pid=(\d+)\b/)) != null)
return formatLink(value, `Archive post #${m[1]}`);
else if ((m = value.match(/\/t\/([^\/]{5,})(?:\/\d+\b|$)/)) != null)
else if ((m = value.match(/\/t\/([^\/]{5,})(?:\/\d+\b|\/?$)/)) != null)
return formatLink(value, `Discourse: ${m[1]}`);
else
return formatLink(value, value);
Expand Down

0 comments on commit 4c0ff83

Please sign in to comment.