private void ParseSpecialCharacters(string content, ref int pos) { _whitespaceRemoval = WhitespaceRemoval.None; IsSelfClosing = false; while (pos < content.Length) { if (ParseWhitespaceRemoval(content, ref pos)) { continue; } if (ParseSelfClosing(content, ref pos)) { continue; } break; } }
private bool ParseWhitespaceRemoval(string content, ref int pos) { if (_whitespaceRemoval != WhitespaceRemoval.None) { return(false); } switch (content[pos]) { case '>': _whitespaceRemoval = WhitespaceRemoval.Surrounding; pos++; return(true); case '<': _whitespaceRemoval = WhitespaceRemoval.Internal; pos++; return(true); } return(false); }
public void Walk_TagWithWhitespaceSupression_SetsCorrectFlag(string templateLine, WhitespaceRemoval expectedSetting) { var tag = new HamlNodeTag(new HamlLine(templateLine, HamlRuleEnum.Tag, indent: "")); Assert.That(tag.WhitespaceRemoval, Is.EqualTo(expectedSetting)); }
private bool ParseWhitespaceRemoval(string content, ref int pos) { if (_whitespaceRemoval != WhitespaceRemoval.None) return false; switch (content[pos]) { case '>': _whitespaceRemoval = WhitespaceRemoval.Surrounding; pos++; return true; case '<': _whitespaceRemoval = WhitespaceRemoval.Internal; pos++; return true; } return false; }
private void ParseSpecialCharacters(string content, ref int pos) { _whitespaceRemoval = WhitespaceRemoval.None; IsSelfClosing = false; while (pos < content.Length) { if (ParseWhitespaceRemoval(content, ref pos)) continue; if (ParseSelfClosing(content, ref pos)) continue; break; } }
public void Walk_TagWithWhitespaceSupression_SetsCorrectFlag(string templateLine, WhitespaceRemoval expectedSetting) { var tag = new HamlNodeTag(new HamlLine(templateLine, HamlRuleEnum.Tag, "", 0)); Assert.That(tag.WhitespaceRemoval, Is.EqualTo(expectedSetting)); }