add automatic linking of referenced issues - resolves #808 default tip

Fri, 20 Feb 2026 16:30:17 +0100

author
Mike Becker <universe@uap-core.de>
date
Fri, 20 Feb 2026 16:30:17 +0100
changeset 413
0523585f1742
parent 412
e0119fb1b442

add automatic linking of referenced issues - resolves #808

src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog-de.jspf file | annotate | diff | comparison | revisions
src/main/webapp/WEB-INF/changelogs/changelog.jspf file | annotate | diff | comparison | revisions
--- a/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt	Fri Feb 20 15:27:09 2026 +0100
+++ b/src/main/kotlin/de/uapcore/lightpit/logic/IssueLogic.kt	Fri Feb 20 16:30:17 2026 +0100
@@ -316,11 +316,21 @@
     ).build()
 
     val formatEmojis = { text: String ->
-        text
-            .replace("(/)", "&#9989;")
+        text.replace("(/)", "&#9989;")
             .replace("(x)", "&#10060;")
             .replace("(!)", "&#9889;")
     }
 
-    return renderer.render(parser.parse(formatEmojis(text)))
+    val createIssueLinks = { text: String ->
+        text.replace("##", "&#35;")
+            .replace(Regex("""(?:^|\s)#([0-9]+)\b"""), { match ->
+                val issueId = match.groupValues[1]
+                match.value.replace("#${issueId}", "[#${issueId}](./issues/${issueId}?in_project=true)")
+            })
+    }
+
+    return text.let(createIssueLinks)
+        .let( formatEmojis)
+        .let(parser::parse)
+        .let(renderer::render)
 }
--- a/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Fri Feb 20 15:27:09 2026 +0100
+++ b/src/main/webapp/WEB-INF/changelogs/changelog-de.jspf	Fri Feb 20 16:30:17 2026 +0100
@@ -35,6 +35,7 @@
     <li>Es können nun neue Vorgänge direkt mit einer Verknüpfung zu einem existierenden Vorgang erstellt werden.</li>
     <li>Neuen Filter "zeige nur nicht-blockierte" hinzugefügt.</li>
     <li>Vorschau für Markdown hinzugefügt.</li>
+    <li>Automatisches Erzeugen von Links, wenn ein Vorgang über seine #Nummer referenziert wird, hinzugefügt.</li>
     <li>Vorgänge können nun auch direkt über die Vorgangsnummer (anstatt Raute + Nummer) verlinkt werden.</li>
     <li>Die Vorschläge in den Suchfeldern für Vorgänge sind nun absteigend nach Vorgangsnummer sortiert.</li>
     <li>Die Standardkategorie für neue Vorgänge in veröffentlichten Versionen ist nun "Fehler" anstelle von "Feature".</li>
--- a/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Fri Feb 20 15:27:09 2026 +0100
+++ b/src/main/webapp/WEB-INF/changelogs/changelog.jspf	Fri Feb 20 16:30:17 2026 +0100
@@ -35,6 +35,7 @@
     <li>Add the possibility to create new related issues with one click.</li>
     <li>Add new filter "show only non-blocked".</li>
     <li>Add markdown preview.</li>
+    <li>Add automatic link creation when referencing other issues by #number.</li>
     <li>Change that you can now relate issues by just submitting their number (instead of hash + number).</li>
     <li>Change that issues suggested by the search boxes are now sorted by ID in descending order.</li>
     <li>Change that the default category for new issues in released versions is Bug instead of Feature.</li>

mercurial