Skip to content

Commit 75dd3a0

Browse files
authored
Merge pull request #731 from htacg/issue-726
Issue 726 upper case anchors
2 parents 86b52dc + dc28b34 commit 75dd3a0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/attrs.c

+5-2
Original file line numberDiff line numberDiff line change
@@ -997,13 +997,16 @@ void TY_(RemoveAnchorByNode)( TidyDocImpl* doc, ctmbstr name, Node *node )
997997
FreeAnchor( doc, delme );
998998
}
999999

1000-
/* initialize new anchor */
1000+
/* initialize new anchor
1001+
Is. #726 & #185 - HTML5 is case-sensitive
1002+
*/
10011003
static Anchor* NewAnchor( TidyDocImpl* doc, ctmbstr name, Node* node )
10021004
{
10031005
Anchor *a = (Anchor*) TidyDocAlloc( doc, sizeof(Anchor) );
10041006

10051007
a->name = TY_(tmbstrdup)( doc->allocator, name );
1006-
a->name = TY_(tmbstrtolower)(a->name);
1008+
if (!TY_(IsHTML5Mode)(doc)) /* Is. #726 - if NOT HTML5, to lowercase */
1009+
a->name = TY_(tmbstrtolower)(a->name);
10071010
a->node = node;
10081011
a->next = NULL;
10091012

0 commit comments

Comments
 (0)