diff --git a/core/modules/utils/fakedom.js b/core/modules/utils/fakedom.js index 13f162f69..0d6ea6d42 100755 --- a/core/modules/utils/fakedom.js +++ b/core/modules/utils/fakedom.js @@ -134,7 +134,7 @@ Object.defineProperty(TW_Element.prototype, "outerHTML", { for(a=0; a 0) { - output.push(" style='",style.join(""),"'") + output.push(" style=\"",style.join(""),"\"") } } output.push(">"); diff --git a/core/modules/utils/utils.js b/core/modules/utils/utils.js index 35bc1ff32..eed24a840 100644 --- a/core/modules/utils/utils.js +++ b/core/modules/utils/utils.js @@ -363,10 +363,10 @@ exports.getRelativeDate = function(delta) { }; }; -// Convert & to "&", < to "<", > to ">", " to """ ' to "'" +// Convert & to "&", < to "<", > to ">", " to """ exports.htmlEncode = function(s) { if(s) { - return s.toString().replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,""").replace(/\'/mg,"'"); + return s.toString().replace(/&/mg,"&").replace(//mg,">").replace(/\"/mg,"""); } else { return ""; } diff --git a/editions/test/tiddlers/tests/test-widget.js b/editions/test/tiddlers/tests/test-widget.js index 95536fb63..a1ad79823 100755 --- a/editions/test/tiddlers/tests/test-widget.js +++ b/editions/test/tiddlers/tests/test-widget.js @@ -69,7 +69,7 @@ describe("Widget module", function() { var wrapper = renderWidgetNode(widgetNode); describe("should render", function() { // Test the rendering - expect(wrapper.innerHTML).toBe("A text node
and the content of a DIV
and an inner DIV
and back in the outer DIV
"); + expect(wrapper.innerHTML).toBe("A text node
and the content of a DIV
and an inner DIV
and back in the outer DIV
"); // Test the sequence numbers in the DOM expect(wrapper.sequenceNumber).toBe(0); expect(wrapper.children[0].sequenceNumber).toBe(1); @@ -113,7 +113,7 @@ describe("Widget module", function() { var wrapper = renderWidgetNode(widgetNode); describe("should render", function() { // Test the rendering - expect(wrapper.innerHTML).toBe("A text node
and the content of a DIV
and an inner DIV
and back in the outer DIVthe quick brown fox
the quick brown fox"); + expect(wrapper.innerHTML).toBe("A text node
and the content of a DIV
and an inner DIV
and back in the outer DIVthe quick brown fox
the quick brown fox"); // Test the sequence numbers in the DOM expect(wrapper.sequenceNumber).toBe(0); expect(wrapper.children[0].sequenceNumber).toBe(1); @@ -131,7 +131,7 @@ describe("Widget module", function() { refreshWidgetNode(widgetNode,wrapper,["TiddlerOne"]); describe("should refresh", function() { // Test the refreshing - expect(wrapper.innerHTML).toBe("A text node
and the content of a DIV
and an inner DIV
and back in the outer DIVjumps over the lazy dog
jumps over the lazy dog"); + expect(wrapper.innerHTML).toBe("A text node
and the content of a DIV
and an inner DIV
and back in the outer DIVjumps over the lazy dog
jumps over the lazy dog"); // Test the sequence numbers in the DOM expect(wrapper.sequenceNumber).toBe(0); expect(wrapper.children[0].sequenceNumber).toBe(1); @@ -163,7 +163,7 @@ describe("Widget module", function() { var wrapper = renderWidgetNode(widgetNode); describe("should detect the recursion", function() { // Test the rendering - expect(wrapper.innerHTML).toBe("Recursive transclusion error in transclude widget\n"); + expect(wrapper.innerHTML).toBe("Recursive transclusion error in transclude widget\n"); }); }); @@ -171,12 +171,12 @@ describe("Widget module", function() { it("should deal with SVG elements", function() { var wiki = new $tw.Wiki(); // Construct the widget node - var text = "\n"; + var text = "\n"; var widgetNode = createWidgetNode(parseText(text,wiki,{parseAsInline:true}),wiki); // Render the widget node to the DOM var wrapper = renderWidgetNode(widgetNode); // Test the rendering - expect(wrapper.innerHTML).toBe("\n"); + expect(wrapper.innerHTML).toBe("\n"); expect(wrapper.firstChild.namespaceURI).toBe("http://www.w3.org/2000/svg"); }); @@ -268,7 +268,7 @@ describe("Widget module", function() { // Render the widget node to the DOM var wrapper = renderWidgetNode(widgetNode); // Test the rendering - expect(wrapper.innerHTML).toBe("

Content

"); + expect(wrapper.innerHTML).toBe("

Content

"); }); it("should deal with built-in macros", function() { @@ -283,7 +283,7 @@ describe("Widget module", function() { // Render the widget node to the DOM var wrapper = renderWidgetNode(widgetNode); // Test the rendering - expect(wrapper.innerHTML).toBe("

My linky link

"); + expect(wrapper.innerHTML).toBe("

My linky link

"); }); it("should deal with the list widget", function() { diff --git a/editions/test/tiddlers/tests/test-wikitext.js b/editions/test/tiddlers/tests/test-wikitext.js index ad7e96bde..37cbf65ed 100644 --- a/editions/test/tiddlers/tests/test-wikitext.js +++ b/editions/test/tiddlers/tests/test-wikitext.js @@ -43,7 +43,7 @@ describe("WikiText tests", function() { expect(wiki.renderTiddler("text/html","TiddlerThree")).toBe("

The speed of sound

The light of speed

"); }); it("should support attributes specified as macro invocations", function() { - expect(wiki.renderTiddler("text/html","TiddlerFour")).toBe("

This is a link

"); + expect(wiki.renderTiddler("text/html","TiddlerFour")).toBe("

This is a link

"); }); it("should identify wikiwords to automatically link", function() { expect(wiki.renderText("text/html","text/vnd-tiddlywiki","No wikilinks here").indexOf("