diff --git a/Nustache.Core.Tests/Describe_Helpers.cs b/Nustache.Core.Tests/Describe_Helpers.cs
index f7501e0..88b3827 100644
--- a/Nustache.Core.Tests/Describe_Helpers.cs
+++ b/Nustache.Core.Tests/Describe_Helpers.cs
@@ -1,5 +1,5 @@
-using System.Collections;
-using NUnit.Framework;
+using NUnit.Framework;
+using System.Collections;
namespace Nustache.Core.Tests
{
@@ -72,7 +72,7 @@ public void It_passes_arguments_into_block_helpers()
}
[Test]
- public void It_parses_quoted_arguments_as_literal_strings()
+ public void It_parses_double_quoted_arguments_as_literal_strings()
{
Helpers.Register("link", (ctx, args, opts, fn, inverse) => ctx.Write(string.Format("{1}", args[1], args[0])));
@@ -81,6 +81,16 @@ public void It_parses_quoted_arguments_as_literal_strings()
Assert.AreEqual("TEXT", result);
}
+ [Test]
+ public void It_parses_single_quoted_arguments_as_literal_strings()
+ {
+ Helpers.Register("link", (ctx, args, opts, fn, inverse) => ctx.Write(string.Format("{1}", args[1], args[0])));
+
+ var result = Render.StringToString("{{link 'TEXT' 'URL'}}", new {});
+
+ Assert.AreEqual("TEXT", result);
+ }
+
[Test]
public void It_parses_quoted_options_as_literal_strings()
{
@@ -91,6 +101,16 @@ public void It_parses_quoted_options_as_literal_strings()
Assert.AreEqual("TEXT", result);
}
+ [Test]
+ public void It_parses_quoted_options_with_spaces_as_literal_strings()
+ {
+ Helpers.Register("link", (ctx, args, opts, fn, inverse) => ctx.Write(string.Format("{1}", opts["url"], opts["text"])));
+
+ var result = Render.StringToString("{{link text=\"ANCHOR TEXT\" url=\"URL\"}}", new { });
+
+ Assert.AreEqual("ANCHOR TEXT", result);
+ }
+
[Test]
public void It_registers_each_by_default()
{
diff --git a/Nustache.Core/Helpers.cs b/Nustache.Core/Helpers.cs
index fd07f93..9fbaa83 100644
--- a/Nustache.Core/Helpers.cs
+++ b/Nustache.Core/Helpers.cs
@@ -1,6 +1,6 @@
-using System;
-using System.Collections;
+using System.Collections;
using System.Collections.Generic;
+using System.Text.RegularExpressions;
namespace Nustache.Core
{
@@ -43,7 +43,7 @@ static Helpers()
public static void EachHelper(RenderContext context, IList