Details
-
Bug
-
Status: Open
-
Medium
-
Resolution: Unresolved
-
Xporter Cloud [SilentRelease]
-
None
-
None
-
Cloud
Description
Using JavaScript in templates is causing blank lines to appear.
Steps to reproduce:
Use the following code in a template:
%{const months = ["Jan ", "Feb ", "Mar ", "Apr ", "May ", "Jun ", "Jul ", "Aug ", "Sep ", “Oct ", "Nov ", "Dec "];}
%{ function mt(date) {return months[date.getUTCMonth()] + String(date.getUTCDate()) + “, “ }}
%{ function yr(date) {return date.getUTCFullYear() + “ “}}
%{ function tm(date) {return String(date.getUTCHours()).padStart(2,’0’) + “:“ + String(date.getUTCMinutes()).padStart(2,’0’) }}
%{ function formatMyDated(date) {return date.toUTCString()}}
%{ function formatMyDate(date) {return mt( date) + yr(date) + tm(date) + ‘ UTC’}}
Actual Result:
A new line will be created for each code block:
Expected Result:
No new lines should be created.