4
0
mirror of https://github.com/art-ist/mustache-sharp.git synced 2024-06-16 21:05:32 +00:00
MustacheSharp/mustache-sharp/NewlineTagDefinition.cs
Travis Parks f136dd61a5 Begin implementation of context scopes.
Instead of context data being a single object, it now supports the same
scoping rules as keys.
Now the #index tag is always available.
2013-08-16 23:36:06 -04:00

32 lines
952 B
C#

using System;
using System.Collections.Generic;
using System.IO;
namespace Mustache
{
/// <summary>
/// Defines a tag that outputs a newline.
/// </summary>
internal sealed class NewlineTagDefinition : InlineTagDefinition
{
/// <summary>
/// Initializes a new instance of an NewlineTagDefinition.
/// </summary>
public NewlineTagDefinition()
: base("newline")
{
}
/// <summary>
/// Gets the text to output.
/// </summary>
/// <param name="writer">The writer to write the output to.</param>
/// <param name="arguments">The arguments passed to the tag.</param>
/// <param name="context">Extra data passed along with the context.</param>
public override void GetText(TextWriter writer, Dictionary<string, object> arguments, Scope context)
{
writer.Write(Environment.NewLine);
}
}
}