Quantcast
Channel: Issues for Drupal core
Viewing all articles
Browse latest Browse all 314070

ajax.js insert command sometimes wraps content in a div, potentially producing invalid HTML and other bugs

$
0
0

Problem/Motivation

Currently, Drupal.AjaxCommands.prototype.insert() always wraps the returned HTML in a div. There are multiple conditions where even the more limited DIV wrapping creates problems (see comments #41-#48).

Proposed resolution

Do not wrap the returned content at all. No confusing logic on what gets wrapped and what does not. See #246 - #257 for some additional context on this decision.

// Parse response.data into an element collection.
const $newContent = $($.parseHTML(response.data, true));

// ...

// Add the new content to the page.
$wrapper[method]($newContent);

See #296 for the latest patch.

Remaining tasks

🎉™️


Viewing all articles
Browse latest Browse all 314070

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>