marc_s
marc_s

Reputation: 755187

Trouble with mustache-sharp multiplying empty lines

I have this template in mustache-sharp:

Good Day,
{{#newline}}
The following asset has been retired by {{Actor}}:
{{#newline}}
{{AssetNumber}}: {{AssetDescription}}
Date retirement: {{DateRetired:dd.MM.yyyy}}
{{#newline}}
Comment: {{Comment}} 
{{#newline}}
{{#newline}}
Best Regards
{{#newline}}
Team Finances
{{#newline}}
{{#newline}}
Link: {{SystemUrl}}

When my ASP.NET Core 7.0 Web API renders this into an e-mail, I get this output:

Good Day,
(nl1)
(nl2)
The following asset has been retired by Scheuner Marc (snm2):
(nl1)
(nl2)
1900007.0: HKB: Swisson sinus Dimmer
Date retirement: 31.05.2023 22:00:00
Comment: (some witty informational comment here)
(nl1)
(nl2)
(nl3)
(nl4)
Best Regards
(nl1)
(nl2)
Team Finances 
(nl1)
(nl2)
(nl3)
(nl4)
Link: https://investa-dev.bfh.ch

(The (nl#) indicators are just to visualize how many newlines I get - those aren't really present in the output, just here to make my point clear)

It appears as if rendering the mustache-sharp template duplicates each and every single {{#newline}} placeholder, and returns two empty/newlines for each placeholder.

Is there anything I can do to stop this? I'd really like the tool to render the template as defined - and not add extra empty lines at random ...

Upvotes: 1

Views: 89

Answers (0)

Related Questions