diff --git a/src/main/kotlin/com/vandenbreemen/ktt/view/plugins/PageLinkPlugin.kt b/src/main/kotlin/com/vandenbreemen/ktt/view/plugins/PageLinkPlugin.kt index 5e0a964..7b3df69 100644 --- a/src/main/kotlin/com/vandenbreemen/ktt/view/plugins/PageLinkPlugin.kt +++ b/src/main/kotlin/com/vandenbreemen/ktt/view/plugins/PageLinkPlugin.kt @@ -11,7 +11,7 @@ class PageLinkPlugin(private val repository: SQLiteWikiRepository): PageRenderin val prefixChar = it.groupValues[1] repository.searchPageByTitle(linkText)?.let { existingPageId-> - return@replace "[$linkText](/page/$existingPageId)" + return@replace "$prefixChar[$linkText](/page/$existingPageId)" } "$prefixChar[$linkText](/page/create/$linkText)" diff --git a/src/test/kotlin/com/vandenbreemen/ktt/view/PageRenderingInteractorTest.kt b/src/test/kotlin/com/vandenbreemen/ktt/view/PageRenderingInteractorTest.kt index 2f6ee4e..83c704c 100644 --- a/src/test/kotlin/com/vandenbreemen/ktt/view/PageRenderingInteractorTest.kt +++ b/src/test/kotlin/com/vandenbreemen/ktt/view/PageRenderingInteractorTest.kt @@ -169,4 +169,22 @@ This test contains a link to a link that you can try out. rendered.shouldContain("