Skip to content

Commit

Permalink
Remove special handling of <isindex> tag.
Browse files Browse the repository at this point in the history
Follows update to HTML5 spec: whatwg/html#1088
  • Loading branch information
cscott committed Oct 18, 2016
1 parent 2966cf6 commit fd18309
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 52 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* HTML5 spec update: <menuitem> is no longer an empty element.
* HTML5 spec update: tweaked HTML entity parsing in attributes.
* HTML5 spec update: dashes are allowed in HTML comments.
* HTML5 spec update: remove special handling of <isindex>.

# domino 1.0.26 (15 Oct 2016)
* Implement Document#dir.
Expand Down
53 changes: 1 addition & 52 deletions lib/HTMLParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ specialSet[NAMESPACE.HTML] = {
"h2":true, "h3":true, "h4":true, "h5":true,
"h6":true, "head":true, "header":true, "hgroup":true,
"hr":true, "html":true, "iframe":true, "img":true,
"input":true, "isindex":true, "li":true, "link":true,
"input":true, "li":true, "link":true,
"listing":true, "main":true, "marquee":true, "menu":true, "meta":true,
"nav":true, "noembed":true, "noframes":true, "noscript":true,
"object":true, "ol":true, "p":true, "param":true,
Expand Down Expand Up @@ -5889,57 +5889,6 @@ function HTMLParser(address, fragmentContext, options) {
in_body_mode(TAG, "img", arg3, arg4);
return;

case "isindex":
if (form_element_pointer && !stack.contains("template")) return;
(function handleIsIndexTag(attrs) {
var prompt = null;
var form_action = null;
var newattrs = [["name", "isindex"]];
for(var i = 0; i < attrs.length; i++) {
var a = attrs[i];
if (a[0] === "action") {
form_action = a[1];
}
else if (a[0] === "prompt") {
prompt = a[1];
}
else if (a[0] !== "name") {
newattrs.push(a);
}
}

// This default prompt presumably needs localization.
// The space after the colon in this prompt is required
// by the html5lib test cases
if (!prompt)
prompt = "This is a searchable index. " +
"Enter search keywords: ";

var form = insertHTMLElement('form', []);
if (!stack.contains("template")) {
form_element_pointer = form;
}
if (form_action !== null) {
form._setAttribute('action', form_action);
}
insertHTMLElement('hr', []);
stack.pop();
afereconstruct();
insertHTMLElement('label', []);
insertText(prompt);
insertHTMLElement('input', newattrs);
stack.pop();
insertText(''); // "Insert more characters" from the spec.
stack.pop();
insertHTMLElement('hr', []);
stack.pop();
stack.pop(); // form element
if (!stack.contains("template")) {
form_element_pointer = null;
}
}(arg3));
return;

case "textarea":
insertHTMLElement(value,arg3);
ignore_linefeed = true;
Expand Down

0 comments on commit fd18309

Please sign in to comment.