         { [ dup "\t\n\f\s" member? ] [ drop before-doctype-public-identifier-state ] }
         { [ dup CHAR: " = ] [ missing-whitespace-after-doctype-public-keyword ] }
         { [ dup CHAR: ' = ] [ missing-whitespace-after-doctype-public-keyword ] }
-        { [ dup CHAR: > = ] [ drop missing-doctype-public-identifier force-quirks-flag-on data-state ] }
-        { [ dup f = ] [ drop eof-in-doctype pick [ emit-doctype-token ] [ emit-eof ] bi ] }
+        { [ dup CHAR: > = ] [ drop missing-doctype-public-identifier force-quirks data-state ] }
+        { [ dup f = ] [ drop eof-in-doctype pick [ emit-doctype ] [ emit-eof ] bi ] }
         [
             missing-quote-before-doctype-public-identifier
-            [ reach force-quirks-flag-on ] dip
+            [ reach force-quirks ] dip
             (bogus-doctype-state)
         ]
     } cond ;



: (before-doctype-name-state) ( document n/f string ch/f -- document n'/f string )
B
    {
        { [ dup "\t\n\f\s" member? ] [ drop before-doctype-name-state ] }
        { [ dup ascii-upper-alpha? ] [ 0x20 + reach push-tag-name tag-name-state ] }
        { [ dup CHAR: \0 = ] [
            drop
            unexpected-null-character
            CHAR: replacement-character make-doctype-token reach doctype-token<<
            doctype-name-state
        ] }
        [ make-doctype-token reach doctype-token<< doctype-name-state ]
    } cond ;

: before-doctype-name-state ( document n/f string -- document n'/f string )


: (end-tag-open-state) ( document n/f string ch/f -- document n'/f string )
    {
        { [ dup ascii-alpha? ] [ reach new-end-tag (tag-name-state) ] }
        { [ dup CHAR: > = ] [ missing-end-tag-name ] }
        { [ dup f = ] [ eof-before-tag-name ] }
        [ invalid-first-character-of-tag-name ]
