public void Walk_TextNode_AppendsCorrectTag() { // Arrange var content = new HamlLine("Simple content"); var document = new HamlDocument { new HamlNodeText(content) }; // Act var builder = new ClassBuilderMock(); new HamlDocumentWalker(builder).Walk(document, ""); // Assert Assert.That(builder.Build(""), Is.EqualTo(content.Content)); }
private HamlNode GetHamlNode(HamlLine nodeLine) { switch (nodeLine.HamlRule) { case HamlRuleEnum.PlainText: return new HamlNodeText(nodeLine); case HamlRuleEnum.Tag: return new HamlNodeTag(nodeLine); case HamlRuleEnum.HamlComment: return new HamlNodeHamlComment(nodeLine); case HamlRuleEnum.HtmlComment: return new HamlNodeHtmlComment(nodeLine); default: throw new HamlUnknownRuleException(nodeLine.Content); } }
private void HandleInlineContent(string content, ref int pos) { if (pos < content.Length) { var contentLine = new HamlLine(content.Substring(pos).TrimStart()); Add(new HamlNodeText(contentLine)); } }
public void AddLine(HamlLine line) { _hamlLines.Add(line); }