Skip to content

Commit 0d9fc6e

Browse files
committed
Test .innerHTML with less-than character
Fixes jsdom#652. Could not reproduce bug behaviour with htmlparser2. Was this already fixed?
1 parent e7eb26f commit 0d9fc6e

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

test/jsdom/parsing.js

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -221,3 +221,24 @@ exports["Handle more non-standard markup (GH-88)"] = function (t) {
221221

222222
t.done();
223223
};
224+
225+
exports[".innerHTML with < character (GH-652)"] = function (t) {
226+
jsdom.env({
227+
html: "<html>",
228+
done: function (errs, window) {
229+
t.ifError(errs);
230+
231+
var doc = window.document;
232+
233+
var script = doc.createElement("script");
234+
script.innerHTML = "5 < 3";
235+
t.strictEqual(script.innerHTML, "5 < 3");
236+
237+
var p = doc.createElement("p");
238+
p.innerHTML = "5 < 3";
239+
t.strictEqual(p.innerHTML, "5 &lt; 3");
240+
241+
t.done();
242+
}
243+
});
244+
};

0 commit comments

Comments
 (0)