Permalink
Browse files

Refs #315. (passing) test case. Looks like this isn't a bug?

  • Loading branch information...
1 parent 75490cf commit ac1932c8e1fe6e41e44c16cef691ee73393e7adb @winhamwr winhamwr committed Jun 22, 2012
Showing with 36 additions and 4 deletions.
  1. +36 −1 src/test/unit/test.js
  2. +0 −3 src/wymeditor/parser/xhtml-validator.js
View
@@ -402,6 +402,41 @@ test("no-op on table with colgroup generates valid XHTML", function () {
equals(jQuery.wymeditors(0).parser.parse(tableWithColXHtml), tableWithColXHtml);
});
+test("Should allow arbitrary rel values", function () {
+ var exampleRels = [
+ 'alternate',
+ 'appendix',
+ 'bookmark',
+ 'chapter',
+ 'contents',
+ 'copyright',
+ 'glossary',
+ 'help',
+ 'home',
+ 'index',
+ 'next',
+ 'prev',
+ 'section',
+ 'start',
+ 'stylesheet',
+ 'subsection',
+ ' ',
+ 'shortcut',
+ 'nofollow',
+ 'moodalbox',
+ 'lightbox',
+ 'icon'
+ ],
+ expected,
+ i;
+ expect(exampleRels.length);
+
+ for (i = 0; i < exampleRels.length; i++) {
+ expected = '<p><a rel="' + exampleRels[i] + '">foo</a></p>';
+ equals(jQuery.wymeditors(0).parser.parse(expected), expected);
+ }
+});
+
module("Post Init", {setup: setupWym});
test("Sanity check: html()", function () {
@@ -997,7 +1032,7 @@ if ($.browser.webkit || $.browser.safari) {
'<div>Anything</div>' +
'<p>Some text after the div container</p>';
- test("DIV element is correctly inserted", function() {
+ test("DIV element is correctly inserted", function () {
var initHtml = String() +
'<p>Some text before the div container</p>' +
'<p id="replaceMe">Replace me</p>' +
@@ -350,9 +350,6 @@ WYMeditor.XhtmlValidator = {
"1":"href",
"2":"hreflang",
"media":/^(all|braille|print|projection|screen|speech|,|;| )+$/i,
- //next comment line required by Opera!
- /*"rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,*/
- "rel":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,
"rev":/^(alternate|appendix|bookmark|chapter|contents|copyright|glossary|help|home|index|next|prev|section|start|stylesheet|subsection| |shortcut|icon)+$/i,
"3":"type"
},

0 comments on commit ac1932c

Please sign in to comment.