Avoid replace URL cross multiple line of text

This commit is contained in:
Wang Zichong
2022-11-22 16:14:58 +08:00
parent 8463aafd7b
commit 7ee79ee93a

View File

@@ -229,7 +229,7 @@ Kirigami.OverlayDrawer {
TextEdit {
Layout.fillWidth: true
text: room && room.topic ? room.topic.replace(replaceLinks, "<a href=\"$1\">$1</a>") : i18n("No Topic")
readonly property var replaceLinks: /(https:\/\/[^ ]*)/
readonly property var replaceLinks: /(http[s]?:\/\/[^ \r\n]*)/g
textFormat: TextEdit.MarkdownText
wrapMode: Text.WordWrap
selectByMouse: true