From 8723681275ce1a1ec43f11c21db196698878cca2 Mon Sep 17 00:00:00 2001 From: Geoff McLane Date: Mon, 23 Apr 2018 19:00:36 +0200 Subject: [PATCH] PR #712 - Only allow 'auto' on 'dir' for HTML5 modified: src/attrs.c --- src/attrs.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/attrs.c b/src/attrs.c index fd536e5..0fd0241 100644 --- a/src/attrs.c +++ b/src/attrs.c @@ -2015,8 +2015,11 @@ void CheckScroll( TidyDocImpl* doc, Node *node, AttVal *attval) /* checks dir attribute */ void CheckTextDir( TidyDocImpl* doc, Node *node, AttVal *attval) { - ctmbstr const values[] = {"rtl", "ltr", "auto", NULL}; - CheckAttrValidity( doc, node, attval, values ); + ctmbstr const values4[] = { "rtl", "ltr", NULL }; + /* PR #712 - add 'auto' for HTML5 - @doronbehar */ + ctmbstr const values5[] = { "rtl", "ltr", "auto", NULL }; + CheckAttrValidity(doc, node, attval, + (TY_(IsHTML5Mode)(doc) ? values5 : values4)); } /* checks lang and xml:lang attributes */