Fix the "isindex" attributes handling in the "in body" insertion mode

This commit is contained in:
iska
2015-04-11 00:36:37 +02:00
parent 27817fb7ec
commit db0bb51bc5
+7 -4
View File
@@ -1301,10 +1301,13 @@
NSString *prompt = token.attributes[@"prompt"] ?: @"This is a searchable index. Enter search keywords: ";
[self insertCharacters:prompt];
HTMLStartTagToken *inputToken = [[HTMLStartTagToken alloc] initWithTagName:@"input" attributes:token.attributes];
inputToken.attributes[@"name"] = @"isindex";
[inputToken.attributes removeObjectForKey:@"action"];
[inputToken.attributes removeObjectForKey:@"prompt"];
NSMutableDictionary *attributes = [NSMutableDictionary dictionaryWithDictionary:token.attributes];
attributes[@"name"] = @"isindex";
[attributes removeObjectForKey:@"action"];
[attributes removeObjectForKey:@"prompt"];
HTMLStartTagToken *inputToken = [[HTMLStartTagToken alloc] initWithTagName:@"input" attributes:attributes];
[self insertElementForToken:inputToken];
[_stackOfOpenElements popCurrentNode];
[_stackOfOpenElements popCurrentNode];