diff --git a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee index 019bda635ad87d117d6baa3efa2dec2faf947727..5b223d50f60b77bbf415df6b5ee644a0fd77bb59 100644 --- a/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee +++ b/actionview/app/assets/javascripts/rails-ujs/utils/ajax.coffee @@ -69,7 +69,7 @@ processResponse = (response, type) -> script.setAttribute('nonce', cspNonce()) script.text = response document.head.appendChild(script).parentNode.removeChild(script) - else if type.match(/\bxml\b/) + else if type.match(/\b(xml|html|svg)\b/) parser = new DOMParser() type = type.replace(/;.+/, '') # remove something like ';charset=utf-8' try response = parser.parseFromString(response, type) diff --git a/actionview/test/ujs/public/test/call-remote.js b/actionview/test/ujs/public/test/call-remote.js index 778dc1b09a67c5c6befbf22b9e5a3362b62a4f45..c8813bb82a8d1d8725f520594162aa3d6ecf257e 100644 --- a/actionview/test/ujs/public/test/call-remote.js +++ b/actionview/test/ujs/public/test/call-remote.js @@ -128,17 +128,6 @@ asyncTest('execution of JS code does not modify current DOM', 1, function() { }) }) -asyncTest('HTML content should be plain-text', 1, function() { - buildForm({ method: 'post', 'data-type': 'html' }) - - $('form').append('') - $('form').append('') - - submit(function(e, data, status, xhr) { - ok(data === '

hello

', 'returned data should be a plain-text string') - }) -}) - asyncTest('XML document should be parsed', 1, function() { buildForm({ method: 'post', 'data-type': 'html' })