Created
June 25, 2018 07:31
-
-
Save elringus/8b91ab94b4c0a18666f8f481bb4e1997 to your computer and use it in GitHub Desktop.
Stubble render empty lines for non-existing tags
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Stubble.Core.Builders; | |
using System; | |
class Program | |
{ | |
static string template = | |
@"Lorem ipsum dolor sit amet, consectetur adipiscing elit. | |
{{{ATag}}} | |
{{{ATag}}} | |
{{{ATag}}} | |
{{{ATag}}} | |
Nulla non nulla sit amet ligula fringilla gravida sed vitae felis. | |
{{#ASection}}Aenean eu dui tincidunt risus fringilla fringilla.{{/ASection}} | |
{{#ASection}}Aenean eu dui tincidunt risus fringilla fringilla.{{/ASection}} | |
{{#ASection}}Aenean eu dui tincidunt risus fringilla fringilla.{{/ASection}} | |
{{#ASection}}Aenean eu dui tincidunt risus fringilla fringilla.{{/ASection}} | |
Nulla nisl nulla, vulputate quis dui eget, sagittis placerat neque. Aliquam eu arcu eget elit semper dapibus."; | |
static void Main (string[] args) | |
{ | |
var stubble = new StubbleBuilder().Build(); | |
var document = stubble.Render(template, null); | |
Console.Write(document); | |
Console.ReadKey(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment