aboutsummaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDave Methvin <dave.methvin@gmail.com>2012-08-23 22:19:06 -0400
committerDave Methvin <dave.methvin@gmail.com>2012-08-23 22:19:06 -0400
commit2263134b224fe03b90552369b5007220747fbaf0 (patch)
tree19eafba46df27bccadd3541e8a300cbd91a97325 /test
parentc01e022f33575ed45fb8da65be756fc464d40a24 (diff)
downloadjquery-2263134b224fe03b90552369b5007220747fbaf0.tar.gz
jquery-2263134b224fe03b90552369b5007220747fbaf0.zip
Fix #10863. Allow newlines in JSON data- attributes.
Diffstat (limited to 'test')
-rw-r--r--test/unit/data.js9
1 files changed, 8 insertions, 1 deletions
diff --git a/test/unit/data.js b/test/unit/data.js
index 7f4ad6c36..765aefcd2 100644
--- a/test/unit/data.js
+++ b/test/unit/data.js
@@ -646,5 +646,12 @@ test( "Only check element attributes once when calling .data() - #8909", functio
// clean up data cache
element.remove();
-
});
+
+test( "JSON data- attributes can have newlines", function() {
+ expect(1);
+
+ var x = jQuery("<div data-some='{\n\"foo\":\n\t\"bar\"\n}'></div>");
+ equal( x.data("some").foo, "bar", "got a JSON data- attribute with spaces" );
+ x.remove();
+}); \ No newline at end of file