Skip to content

Commit

Permalink
Merge pull request #28 from feeeper/incorrect-form-tag-processing
Browse files Browse the repository at this point in the history
Fix #26. Exclude 'Form' tag from ElementsFlags
  • Loading branch information
JackWFinlay authored Oct 21, 2016
2 parents b1af100 + e8c65bb commit a1a5b53
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Jsonize.Test/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ public async Task TestCreatingJsonizeMetaObject()
}

[Test]
public async Task TestFormNodeShouldBeNode()
public void TestFormNodeShouldBeNode()
{
JsonizeConfiguration jsonizeConfiguration = new JsonizeConfiguration();

Expand All @@ -151,7 +151,7 @@ public async Task TestFormNodeShouldBeNode()
Assert.AreEqual("{\"node\":\"Document\",\"child\":[{\"tag\":\"html\",\"child\":[{\"tag\":\"head\"},{\"tag\":\"body\",\"child\":[{\"tag\":\"form\"}]}]}]}",
result.Replace("\r\n", "").Replace(" ", ""));
}

private static async Task<JsonizeNode> TestJsonizeAsJsonizeNode()
{
if (_html == null)
Expand Down
2 changes: 2 additions & 0 deletions src/jsonize/Jsonize.cs
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,8 @@ public string HtmlString
/// </summary>
public Jsonize()
{
// Fix #26: Form tag parsed as a text node.
HtmlNode.ElementsFlags.Remove("form");
_htmlDoc = _htmlDoc ?? new HtmlDocument();
_emptyTextNodeHandling = JsonizeConfiguration.DefaultEmptyTextNodeHandling;
_nullValueHandling = JsonizeConfiguration.DefaultNullValueHandling;
Expand Down

0 comments on commit a1a5b53

Please sign in to comment.