Ensure replace function respect new lines in every editor
This commit is contained in:
+3
-2
@@ -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');
|
||||||
|
|||||||
Reference in New Issue
Block a user