Skip to content

Commit

Permalink
Encode expression as javascript to support nested quotes #222
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisala committed Jan 3, 2024
1 parent 29fa9fe commit e75908e
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class ComputedValueRenderer {
default:
expressionType = "evaluate"
}

out << "return ecodata.forms.expressionEvaluator.${expressionType}('${expression}', ${dependantContext}, ${decimalPlaces});\n";
out << "var expression = '${expression.encodeAsJavaScript()}';\n"
out << "return ecodata.forms.expressionEvaluator.${expressionType}(expression, ${dependantContext}, ${decimalPlaces});\n";
}

private int getNumberOfDecimalPlaces(Map model, Map computed) {
Expand Down

1 comment on commit e75908e

@chrisala
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@salomon-j This is the fix to support our use case - please review

Please sign in to comment.