         ] }
         { [ dup CHAR: > = ] [
             drop abrupt-doctype-system-identifier
-            pick [ force-quirks-flag-on ] [ emit-doctype-token ] bi
+            pick [ force-quirks ] [ emit-doctype ] bi
             data-state
         ] }
         { [ dup f = ] [
             drop eof-in-doctype
-            pick [ force-quirks-flag-on ] [ emit-doctype-token ] [ emit-eof ] tri
+            pick [ force-quirks ] [ emit-doctype ] [ emit-eof ] tri
         ] }
         [ reach push-doctype-system-identifier doctype-system-identifier-double-quoted-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 )

    {
        { [ dup "\t\n\f\s" member? ] [ drop after-doctype-system-identifier-state ] }
        { [ dup CHAR: > = ] [
            drop pick emit-doctype
            data-state
        ] }
        { [ dup f = ] [ drop eof-in-doctype pick [ force-quirks ] [ emit-doctype ] [ emit-eof ] tri ] }
        [
            unexpected-character-after-doctype-system-identifier
            [ reach force-quirks ] dip
            (bogus-doctype-state)
        ]
    } cond ;
