Skip to content

Commit 88f4627

Browse files
committed
fix: validation fix for resource questions
1 parent 17636eb commit 88f4627

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/front-end/typescript/lib/components/form-field/plate-editor.tsx

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,15 @@ export const view: component_.base.View<ViewProps> = ({
235235

236236
// Only update if the markdown content has actually changed
237237
if (markdownOutput !== markdownContent) {
238+
// Clean both old and new content to check for meaningful changes
239+
const cleanedOld = cleanPlateEditorValue(markdownContent);
240+
const cleanedNew = cleanPlateEditorValue(markdownOutput);
241+
242+
// Ignore changes that are just PlateJS adding invisible characters to empty content
243+
if (!cleanedOld && !cleanedNew) {
244+
return;
245+
}
246+
238247
// Update the form state with the markdown content
239248
// The Snapshot type is [string, number, number] = [value, selectionStart, selectionEnd]
240249
dispatch(

0 commit comments

Comments
 (0)