From 6d1e4680132db72382a5315e6efd74491ef53bd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Ko=CC=88berle?= Date: Mon, 14 May 2012 08:37:20 +0200 Subject: [PATCH] Avoid filling hr elements --- fixie.js | 3 +++ test/fetch-test.js | 22 ++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/fixie.js b/fixie.js index 6808e3c..8d182ae 100755 --- a/fixie.js +++ b/fixie.js @@ -126,6 +126,9 @@ function () { case 'ul': element.innerHTML = fixie_fetchList(); break; + + case 'hr': + break; default: element.innerHTML = fixie_fetchSentence(); diff --git a/test/fetch-test.js b/test/fetch-test.js index 161ec88..f4ccb40 100644 --- a/test/fetch-test.js +++ b/test/fetch-test.js @@ -48,6 +48,16 @@ describe("fixie minimal", function () { createElementAndTestParagraphAndSentecesAndWordCount(tagName, isSame(3), isSame(3), isSame(4)); }); }); + + ['hr'].forEach(function(tagName){ + + it("should not fill a <" + tagName + ">", function () { + var el = createElementAndInitFixie(tagName); + assert.same('', el.innerHTML); + el.parentNode.removeChild(el); + + }); + }); }); describe("fixie maximal", function () { @@ -80,21 +90,9 @@ describe("fixie maximal", function () { createElementAndTestParagraphAndSentecesAndWordCount(tagName, isSame(7), isSame(7), isSame(9)); }); }); - - }); -describe('fixie', function() -{ - it('should handle sub childs', function () { - var el = createElementAndInitFixie ('div'); - el.innerHTML = '
'; - fixie.init(); - isBetween(3,5)(el.firstChild.firstChild.innerHTML.split(' ').length); - el.parentNode.removeChild(el); - }); -}); function isSame(excpected){ return function(actual) {assert(excpected, actual)};