Skip to content

Commit b0f96f4

Browse files
authored
feat: android - recognize Filament message as a valid html (#43)
1 parent 66669c6 commit b0f96f4

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

android/src/main/java/com/swmansion/reactnativerichtexteditor/ReactNativeRichTextEditorView.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,9 @@ class ReactNativeRichTextEditorView : AppCompatEditText {
148148
if (value == null) return
149149
isSettingValue = true
150150

151-
val isHtml = value.startsWith("<html>") && value.endsWith("</html>")
151+
val isHtmlTagRecognized = value.startsWith("<html>") && value.endsWith("</html>")
152+
val isPTagRecognized = value.startsWith("<p>") && value.endsWith("</p>")
153+
val isHtml = isHtmlTagRecognized || isPTagRecognized
152154
if (isHtml) {
153155
val parsed = EditorParser.fromHtml(value, EditorParser.FROM_HTML_MODE_COMPACT, null, null, linkHandler, mentionHandler)
154156
setText(parsed)

0 commit comments

Comments
 (0)