From 900555467c10558d7693afa38f1ecf269a4f0fc4 Mon Sep 17 00:00:00 2001 From: Julian Waluschyk <37155504+julian-wls@users.noreply.github.com> Date: Thu, 7 Nov 2024 16:55:19 +0100 Subject: [PATCH] Fix Lecture and Exercises Links to be opened inside the app (#89) --- .../core/common/markdown/ArtemisMarkdownTransformer.kt | 2 +- .../core/common/markdown/PostArtemisMarkdownTransformer.kt | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/ArtemisMarkdownTransformer.kt b/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/ArtemisMarkdownTransformer.kt index d7e870ad3..d44563500 100644 --- a/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/ArtemisMarkdownTransformer.kt +++ b/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/ArtemisMarkdownTransformer.kt @@ -21,7 +21,7 @@ abstract class ArtemisMarkdownTransformer { } private val exerciseMarkdownPattern = - "\\[(text|quiz|lecture|modeling|file-upload|programing)](.*)\\(((?:/|\\w|\\d)+)\\)\\[/\\1]".toRegex() + "\\[(text|quiz|lecture|modeling|file-upload|programming)](.*)\\(((?:/|\\w|\\d)+)\\)\\[/\\1]".toRegex() private val userMarkdownPattern = "\\[user](.*?)\\((.*?)\\)\\[/user]".toRegex() private val channelMarkdownPattern = "\\[channel](.*?)\\((\\d+?)\\)\\[/channel]".toRegex() diff --git a/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/PostArtemisMarkdownTransformer.kt b/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/PostArtemisMarkdownTransformer.kt index bba1ed6ad..d17e58434 100644 --- a/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/PostArtemisMarkdownTransformer.kt +++ b/core/common/src/main/kotlin/de/tum/informatics/www1/artemis/native_app/core/common/markdown/PostArtemisMarkdownTransformer.kt @@ -2,7 +2,7 @@ package de.tum.informatics.www1.artemis.native_app.core.common.markdown class PostArtemisMarkdownTransformer(val serverUrl: String, val courseId: Long) : ArtemisMarkdownTransformer() { override fun transformExerciseMarkdown(title: String, url: String): String { - return "[$title]($serverUrl$url)" + return "[$title](artemis:/$url)" } override fun transformUserMentionMarkdown(text: String, fullName: String, userName: String): String = "[@$fullName](artemis://courses/$courseId/messages?username=$userName)"