Ensure replace function respect new lines in every editor

This commit is contained in:
Théo Poizat
2026-02-09 10:34:04 +01:00
committed by Dat H. Pham
parent 17b9d97284
commit 46a12745a5
@@ -63,11 +63,12 @@ extension HandleAiScribeInComposerExtension on ComposerController {
Future<void> setTextInEditor(String text) async { Future<void> setTextInEditor(String text) async {
try { try {
final escapedText = StringConvert.escapeTextContent(text); final escapedText = StringConvert.escapeTextContent(text);
final htmlContent = StringConvert.convertTextContentToHtmlContent(escapedText);
if (PlatformInfo.isWeb) { if (PlatformInfo.isWeb) {
richTextWebController?.editorController.setText(escapedText); richTextWebController?.editorController.setText(htmlContent);
} else { } else {
await richTextMobileTabletController?.htmlEditorApi?.setText(escapedText); await richTextMobileTabletController?.htmlEditorApi?.setText(htmlContent);
} }
} catch (e) { } catch (e) {
logWarning('$runtimeType::setTextInEditor:Exception = $e'); logWarning('$runtimeType::setTextInEditor:Exception = $e');