Browse Source

fix(nocodb-sdk): escapeDoubleQuotes

pull/5270/head
Wing-Kam Wong 2 years ago
parent
commit
e42f7a7d3b
  1. 7
      packages/nocodb-sdk/src/lib/formulaHelpers.ts

7
packages/nocodb-sdk/src/lib/formulaHelpers.ts

@ -179,9 +179,8 @@ export function jsepTreeToFormula(node) {
if (node.type === 'Literal') {
if (typeof node.value === 'string') {
return '"' + node.value + '"';
return String.raw`"${escapeDoubleQuotes(node.value)}"`;
}
return '' + node.value;
}
@ -214,3 +213,7 @@ export function jsepTreeToFormula(node) {
return '';
}
function escapeDoubleQuotes(v: string) {
return v.replace(/"/g, '\\"');
}

Loading…
Cancel
Save