diff options
Diffstat (limited to 'test/unit/data.js')
-rw-r--r-- | test/unit/data.js | 9 |
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 |