예제 #1
0
		public void TestSelfClosing()
		{
			HamlGenerator parser = new HamlGenerator();

			TextReader input = new StringReader("%img{src=\"bild\",border=\"1\"}");
			parser.Parse(input);

			StringWriter output = new StringWriter(new StringBuilder());
			parser.GenerateCode(output);

			Assert.Equal("sb.Append(@\"<img src=\"\"bild\"\" border=\"\"1\"\"/>\");", output.ToString());
		}
예제 #2
0
		protected static string Parse(string text)
		{
			HamlGenerator parser = new HamlGenerator();
			TextReader input = new StringReader(text);
			parser.Parse(input);

			StringBuilder sb = new StringBuilder();
			TextWriter output = new StringWriter(sb);
			parser.GenerateCode(output);

			return output.ToString();
		}