From 03304c21f1a66586358e328bd834b1c2b0c8f143 Mon Sep 17 00:00:00 2001 From: Gibran Chevalley Date: Thu, 6 Jun 2024 14:21:39 +0200 Subject: [PATCH] Prevent entering a blank display text for the URL display text --- .../com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt b/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt index 1abdf8e..847a222 100644 --- a/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt +++ b/rich-html-editor/src/main/java/com/infomaniak/lib/richhtmleditor/RichHtmlEditorWebView.kt @@ -117,7 +117,7 @@ class RichHtmlEditorWebView @JvmOverloads constructor( fun toggleStrikeThrough() = jsBridge.toggleStrikeThrough() fun toggleUnderline() = jsBridge.toggleUnderline() fun removeFormat() = jsBridge.removeFormat() - fun createLink(displayText: String?, url: String) = jsBridge.createLink(displayText, url) + fun createLink(displayText: String?, url: String) = jsBridge.createLink(displayText?.takeIf { it.isNotBlank() }, url) fun unlink() = jsBridge.unlink() /**