From c43413ab9733d63a2321d43c1eb9c9a54bf85d71 Mon Sep 17 00:00:00 2001
From: bobzel <zzzman@gmail.com>
Date: Sat, 30 Mar 2024 11:23:40 -0400
Subject: audio box fixes

---
 src/client/views/nodes/formattedText/FormattedTextBox.tsx | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

(limited to 'src/client/views/nodes/formattedText/FormattedTextBox.tsx')

diff --git a/src/client/views/nodes/formattedText/FormattedTextBox.tsx b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
index b815342e3..5c779734d 100644
--- a/src/client/views/nodes/formattedText/FormattedTextBox.tsx
+++ b/src/client/views/nodes/formattedText/FormattedTextBox.tsx
@@ -1023,7 +1023,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
             const state = this._editorView.state;
             const to = state.selection.to;
             const updated = TextSelection.create(state.doc, to, to);
-            this._editorView.dispatch(state.tr.setSelection(updated).insertText('\n', to));
+            this._editorView.dispatch(state.tr.setSelection(updated).insert(to, state.schema.nodes.paragraph.create({})));
             if (this._recordingDictation) {
                 this.recordDictation();
             }
@@ -1603,7 +1603,7 @@ export class FormattedTextBox extends ViewBoxAnnotatableComponent<FormattedTextB
                 node = state.doc.nodeAt(xpos);
             } catch (e) {}
             if (node?.type !== schema.nodes.dashFieldView) {
-                editor.dispatch(state.tr.setSelection(new TextSelection(state.doc.resolve(xpos))));
+                editor.dispatch(state.tr.setSelection(TextSelection.near(state.doc.resolve(xpos))));
                 let target = e.target as any; // hrefs are stored on the dataset of the <a> node that wraps the hyerlink <span>
                 while (target && !target.dataset?.targethrefs) target = target.parentElement;
                 FormattedTextBoxComment.update(this, editor, undefined, target?.dataset?.targethrefs, target?.dataset.linkdoc, target?.dataset.nopreview === 'true');
-- 
cgit v1.2.3-70-g09d2

