Fix from jst@netscape.com to URL-escape A NAME (bug 87996)

git-svn-id: svn://10.0.0.236/trunk@107439 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
jkeiser%iname.com 2001-11-06 07:14:40 +00:00
parent f538e7840a
commit 5c1f007583

View File

@ -787,6 +787,7 @@ HTMLContentSink::AddAttributes(const nsIParserNode& aNode,
// Add tag attributes to the content attributes
nsAutoString k, v;
PRInt32 ac = aNode.GetAttributeCount();
nsHTMLTag nodeType = nsHTMLTag(aNode.GetNodeType());
for (PRInt32 i = 0; i < ac; i++) {
// Get upper-cased key
@ -802,6 +803,12 @@ HTMLContentSink::AddAttributes(const nsIParserNode& aNode,
// Get value and remove mandatory quotes
GetAttributeValueAt(aNode, i, v);
if (nodeType == eHTMLTag_a && keyAtom == nsHTMLAtoms::name) {
NS_ConvertUCS2toUTF8 cname(v);
v.Assign(NS_ConvertUTF8toUCS2(nsUnescape(NS_CONST_CAST(char *,
cname.get()))));
}
// Add attribute to content
aContent->SetAttr(kNameSpaceID_HTML, keyAtom, v, aNotify);
}