File tree 1 file changed +11
-2
lines changed
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change @@ -4743,12 +4743,21 @@ void TY_(ParseDocument)(TidyDocImpl* doc)
4743
4743
/*\
4744
4744
* #72, avoid MISSING_DOCTYPE if show-body-only.
4745
4745
* #191, also if --doctype omit, that is TidyDoctypeOmit
4746
+ * #342, adjust tags to html4-- if not 'auto' or 'html5'
4746
4747
\*/
4747
- if (!TY_ (FindDocType )(doc ) && ! showingBodyOnly ( doc ) )
4748
+ if (!TY_ (FindDocType )(doc ))
4748
4749
{
4749
4750
ulong dtmode = cfg ( doc , TidyDoctypeMode );
4750
- if (dtmode != TidyDoctypeOmit )
4751
+ if (( dtmode != TidyDoctypeOmit ) && ! showingBodyOnly ( doc ) )
4751
4752
TY_ (ReportError )(doc , NULL , NULL , MISSING_DOCTYPE );
4753
+ if ((dtmode != TidyDoctypeAuto ) && (dtmode != TidyDoctypeHtml5 ))
4754
+ {
4755
+ /*\
4756
+ * Issue #342 - if not doctype 'auto', or 'html5'
4757
+ * then reset mode htm4-- parsing
4758
+ \*/
4759
+ TY_ (AdjustTags )(doc ); /* Dynamically modify the tags table to html4-- mode */
4760
+ }
4752
4761
}
4753
4762
TY_ (InsertNodeAtEnd )( & doc -> root , html );
4754
4763
TY_ (ParseHTML )( doc , html , IgnoreWhitespace );
You can’t perform that action at this time.
0 commit comments