Skip to content

Commit e032e17

Browse files
sideshowbarkerhsivonen
authored andcommitted
Ensure testharness makes missing doctype name null
This change ensures the token handler used by the testharness sets the doctype name to null when the doctype name is missing in the input source. Otherwise, without this change, the testharness token handler sets the doctype name to the empty string — which causes us to fail 9 tests in the html5lib-tests suite. Relates to #35
1 parent 0fde851 commit e032e17

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

test-src/nu/validator/htmlparser/test/JSONArrayTokenHandler.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ public void doctype(String name, String publicIdentifier, String systemIdentifie
9696
flushCharacters();
9797
JSONArray token = new JSONArray();
9898
token.getValue().add(DOCTYPE);
99-
token.getValue().add(new JSONString(name));
99+
token.getValue().add(name == null ? JSONNull.NULL : new JSONString(name));
100100
token.getValue().add(publicIdentifier == null ? JSONNull.NULL : new JSONString(publicIdentifier));
101101
token.getValue().add(systemIdentifier == null ? JSONNull.NULL : new JSONString(systemIdentifier));
102102
token.getValue().add(new JSONBoolean(!forceQuirks));

0 commit comments

Comments
 (0)