Skip to content

Conversation

@jpesce
Copy link

@jpesce jpesce commented May 3, 2022

There are extra spaces (probably due to code autoformatting) in the regex inside the eval helper that make it behave differently from VTEX's actual eval helper. This PR fixes this.

Tests

Here's the result of the expression {{eval "'${string}'.split(' ')[0]" string=_accountInfo.CompanyName}} inside an 'Order Confirmation' template on a VTEX production environment:
Screen Shot 2022-05-03 at 20 08 08

Here's the result in the current version of vtex-emails (before this fix):
Screen Shot 2022-05-03 at 20 06 12

Here's the result after the fix:
Screen Shot 2022-05-03 at 20 07 30

There were extra spaces in the regex inside the eval helper that made it
behave differently from VTEX's actual eval helper (probably due to code
autoformatting).
@jpesce jpesce changed the title Fix eval helper to match VTEX's actual helper Fix eval helper to match VTEX's implementation May 3, 2022
@jpesce
Copy link
Author

jpesce commented Jan 11, 2023

Hi @georgebrindeiro! Any interest in merging this PR?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant