You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@petdance yes, I think this is a bug, and needs to be fixed
This seems yet another case where tidy needs to support the current HTML5 spec...
I can read in style docs <style> can be used In the body, where flow content is expected.... although there are some warning type notes about it...
One quick patch I experimented with was -
diff --git a/src/clean.c b/src/clean.c
index e96dd3f..8023616 100644
--- a/src/clean.c+++ b/src/clean.c@@ -2747,7 +2747,7 @@ static void StyleToHead(TidyDocImpl* doc, Node *head, Node *node, Bool fix, int
TY_(InsertNodeAtEnd)(head, node); /* add to end of head */
TY_(Report)(doc, node, head, MOVED_STYLE_TO_HEAD); /* report move */
}
- else+ else if (!TY_(IsHTML5Mode)(doc)) /* Is. #730 - style allowed in body */
{
TY_(Report)(doc, node, head, FOUND_STYLE_IN_BODY);
}
But maybe this is not the complete story... because this would allow it to be the child of anything... maybe there needs to be more checking... although, with --fix-style-tags no it does fix the sample given...
Note such a fix may also mean adjusting, changing the fix-style-tags documentation, or its yes default, and/or the MOVED_STYLE_TO_HEAD and the FOUND_STYLE_IN_BODY messages...
Look forward to feedback, patches, or PR... thanks...
Here's an HTML file with
<style>
tag outside of the<head>
.Tidy complains about it.
So I do what tidy says and it complains a different complaint.
What can I do to make tidy happy about this situation?
The text was updated successfully, but these errors were encountered: