From 1ecb560bb91a8f3e0fa3d034208a64e3070a689a Mon Sep 17 00:00:00 2001 From: Brent Salisbury Date: Mon, 1 Jul 2024 23:55:10 -0400 Subject: [PATCH] Fix edit submissions to not add single quotes in edited QA fields Closes #35 Signed-off-by: Brent Salisbury --- src/app/edit-submission/knowledge/[id]/page.tsx | 6 +++++- src/app/edit-submission/skill/[id]/page.tsx | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/app/edit-submission/knowledge/[id]/page.tsx b/src/app/edit-submission/knowledge/[id]/page.tsx index 309e919b..03c6c805 100644 --- a/src/app/edit-submission/knowledge/[id]/page.tsx +++ b/src/app/edit-submission/knowledge/[id]/page.tsx @@ -158,7 +158,11 @@ const EditPullRequestPage: React.FunctionComponent<{ params: { id: string } }> = answer: answers[index] })) }; - const updatedYamlContent = yaml.dump(updatedYamlData, { lineWidth: -1 }); + const updatedYamlContent = yaml.dump(updatedYamlData, { + lineWidth: -1, + noCompatMode: true, + quotingType: '"' + }); console.log('Updated YAML content:', updatedYamlContent); diff --git a/src/app/edit-submission/skill/[id]/page.tsx b/src/app/edit-submission/skill/[id]/page.tsx index 18700bc0..8bc0a333 100644 --- a/src/app/edit-submission/skill/[id]/page.tsx +++ b/src/app/edit-submission/skill/[id]/page.tsx @@ -142,7 +142,11 @@ const EditSkillPage: React.FunctionComponent<{ params: { id: string } }> = ({ pa answer: answers[index] })) }; - const updatedYamlContent = yaml.dump(updatedYamlData, { lineWidth: -1 }); + const updatedYamlContent = yaml.dump(updatedYamlData, { + lineWidth: -1, + noCompatMode: true, + quotingType: '"' + }); console.log('Updated YAML content:', updatedYamlContent);