Merge pull request #731 from htacg/issue-726

Issue 726 upper case anchors
This commit is contained in:
Geoff McLane 2018-11-17 18:20:07 +01:00 committed by GitHub
commit 75dd3a03f2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -997,12 +997,15 @@ void TY_(RemoveAnchorByNode)( TidyDocImpl* doc, ctmbstr name, Node *node )
FreeAnchor( doc, delme ); FreeAnchor( doc, delme );
} }
/* initialize new anchor */ /* initialize new anchor
Is. #726 & #185 - HTML5 is case-sensitive
*/
static Anchor* NewAnchor( TidyDocImpl* doc, ctmbstr name, Node* node ) static Anchor* NewAnchor( TidyDocImpl* doc, ctmbstr name, Node* node )
{ {
Anchor *a = (Anchor*) TidyDocAlloc( doc, sizeof(Anchor) ); Anchor *a = (Anchor*) TidyDocAlloc( doc, sizeof(Anchor) );
a->name = TY_(tmbstrdup)( doc->allocator, name ); a->name = TY_(tmbstrdup)( doc->allocator, name );
if (!TY_(IsHTML5Mode)(doc)) /* Is. #726 - if NOT HTML5, to lowercase */
a->name = TY_(tmbstrtolower)(a->name); a->name = TY_(tmbstrtolower)(a->name);
a->node = node; a->node = node;
a->next = NULL; a->next = NULL;