From da27b5e339fb4f470c40cccc6eea681dddf079d0 Mon Sep 17 00:00:00 2001 From: Onni Hakala Date: Mon, 9 Jan 2017 01:38:16 +0200 Subject: [PATCH] Add optional xmlns:xlink attributes as valid to support inline svg fixes #478 --- include/tidyenum.h | 2 ++ src/attrdict.c | 4 ++++ src/attrs.c | 3 +++ 3 files changed, 9 insertions(+) diff --git a/include/tidyenum.h b/include/tidyenum.h index f494afb..05448aa 100644 --- a/include/tidyenum.h +++ b/include/tidyenum.h @@ -808,6 +808,8 @@ typedef enum TidyAttr_AS, /**< AS= */ + TidyAttr_XMLNSXLINK, /**< svg xmls:xlink="url" */ + N_TIDY_ATTRIBS /**< Must be last */ } TidyAttrId; diff --git a/src/attrdict.c b/src/attrdict.c index ca8530e..1a356b4 100644 --- a/src/attrdict.c +++ b/src/attrdict.c @@ -3086,6 +3086,10 @@ const AttrVersion TY_(W3CAttrsFor_SVG)[] = { TidyAttr_WIDTH, xxxx|HT32|H40T|H41T|X10T|H40F|H41F|X10F|H40S|H41S|X10S|XH11|XB10|HT50|XH50 }, { TidyAttr_XML_LANG, xxxx|xxxx|xxxx|xxxx|X10T|xxxx|xxxx|X10F|xxxx|xxxx|X10S|XH11|xxxx|HT50|XH50 }, /* CORE override */ { TidyAttr_XMLNS, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 }, /* CORE override */ + + /* svg xmln:xlink=uri */ + { TidyAttr_XMLNSXLINK, xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|xxxx|XH11|xxxx|HT50|XH50 }, + { TidyAttr_X, xxxx|xxxx|H40T|H41T|X10T|H40F|H41F|X10F|xxxx|H41S|X10S|XH11|xxxx|HT50|XH50 }, { TidyAttr_Y, xxxx|xxxx|H40T|H41T|X10T|H40F|H41F|X10F|xxxx|H41S|X10S|XH11|xxxx|HT50|XH50 }, { TidyAttr_VIEWBOX, xxxx|xxxx|H40T|H41T|X10T|H40F|H41F|X10F|xxxx|H41S|X10S|XH11|xxxx|HT50|XH50 }, diff --git a/src/attrs.c b/src/attrs.c index 849e235..1cf27b2 100644 --- a/src/attrs.c +++ b/src/attrs.c @@ -443,6 +443,9 @@ static const Attribute attribute_defs [] = /* Preload spec: https://www.w3.org/TR/preload/ */ { TidyAttr_AS, "as", CH_PCDATA }, + /* for xmlns:xlink in */ + { TidyAttr_XMLNSXLINK, "xmlns:xlink", CH_URL }, + /* this must be the final entry */ { N_TIDY_ATTRIBS, NULL, NULL } };