jehugaleahsa / mustache-sharp

An extension of the mustache text template engine for .NET.
The Unlicense
306 stars 78 forks source link

Rendering of template simply doubles each {{#newline}} #96

Open marcscheuner-bfh opened 1 year ago

marcscheuner-bfh commented 1 year ago

I have this template:

    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 (hosted in Azure App Service) renders this into an e-mail, I get this output:

Good Day,

The following asset has been retired by Scheuner Marc (snm2):

1900007.0: HKB: Swisson sinus Dimmer
Date retirement: 31.05.2023 22:00:00
Comment: (some witty informational comment here)

Best Regards

Team Finances 

Link: https://investa-dev.bfh.ch

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 ...

wilmos57 commented 1 year ago

Good Day, this here its also a newLine {{#newline}} Good Day, The following asset has been retired by {{Actor}}: