Skip to content
This repository has been archived by the owner on Apr 2, 2021. It is now read-only.

Commit

Permalink
Merge pull request #331 from sjbufton/master
Browse files Browse the repository at this point in the history
Correct handling of <col /> in XHTML
  • Loading branch information
winhamwr committed Feb 14, 2012
2 parents 7ef687d + 5ed7744 commit 586bb78
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
22 changes: 22 additions & 0 deletions src/test/unit/test.js
Expand Up @@ -294,6 +294,28 @@ test("Shouldn't strip colSpan attributes", function () {
);
});

test("no-op on table with colgroup generates valid XHTML", function () {
expect(1);

var tableWithColXHtml = String() +
'<table>' +
'<colgroup>' +
'<col width="20%" />' +
'<col width="30%" />' +
'<col width="50%" />' +
'</colgroup>' +
'<tbody>' +
'<tr id="tr_1">' +
'<td id="td_1_1">1_1</td>' +
'<td id="td_1_2">1_2</td>' +
'<td id="td_1_3">1_3</td>' +
'</tr>' +
'</tbody>' +
'</table>';

equals(jQuery.wymeditors(0).parser.parse(tableWithColXHtml), tableWithColXHtml);
});

module("Post Init", {setup: setupWym});

test("Sanity check: html()", function () {
Expand Down
4 changes: 2 additions & 2 deletions src/wymeditor/parser/xhtml-sax-listener.js
Expand Up @@ -99,7 +99,7 @@ WYMeditor.XhtmlSaxListener = function() {
this.block_tags = [
"a", "abbr", "acronym", "address", "area", "b",
"base", "bdo", "big", "blockquote", "body", "button",
"caption", "cite", "code", "col", "colgroup", "dd", "del", "div",
"caption", "cite", "code", "colgroup", "dd", "del", "div",
"dfn", "dl", "dt", "em", "fieldset", "form", "head", "h1", "h2",
"h3", "h4", "h5", "h6", "html", "i", "ins",
"kbd", "label", "legend", "li", "map", "noscript",
Expand All @@ -109,7 +109,7 @@ WYMeditor.XhtmlSaxListener = function() {
"thead", "title", "tr", "tt", "ul", "var", "extends"];


this.inline_tags = ["br", "hr", "img", "input"];
this.inline_tags = ["br", "col", "hr", "img", "input"];

return this;
};
Expand Down

0 comments on commit 586bb78

Please sign in to comment.