Skip to content
Snippets Groups Projects
Verified Commit 2d482e07 authored by Théodore Biadala's avatar Théodore Biadala
Browse files

Issue #3238870 by shubh_, mstrelan, nod_, hooroomoo, kostyashupenko,...

Issue #3238870 by shubh_, mstrelan, nod_, hooroomoo, kostyashupenko, smustgrave, larowlan, thebumik, lauriii: Refactor (if feasible) use of jquery parseHTML function to use vanillaJS

(cherry picked from commit b4a02610)
parent be402a1a
No related branches found
No related tags found
11 merge requests!13092Issue #3498963 by benjifisher, heddn: Add lookup_migrations configuration to...,!12802Issue #3537193 by opauwlo: Add enable absolute path option for CKEditor5 image uploads,!12745Fixed: Path alias language doesn't changes on changing of node language,!12684Issue #3220784,!12537Add ViewsConfigUpdater deprecation support for default_argument_skip_url,!12523Issue #3493858 by vidorado, xavier.masson, smustgrave: Extend ViewsBlockBase...,!122353526426-warning-for-missing,!11958Issue #3490507 by alexpott, smustgrave: Fix bogus mocking in...,!11769Issue #3517987: Add option to contextual filters to encode slashes in query parameter.,!11185Issue #3477324 by andypost, alexpott: Fix usage of str_getcsv() and fgetcsv() for PHP 8.4,!9944Issue #3483353: Consider making the createCopy config action optionally fail...
Pipeline #201170 passed with warnings
Pipeline: drupal

#201175

    ......@@ -35,7 +35,7 @@
    "jquery/no-param": 2,
    "jquery/no-parent": 0,
    "jquery/no-parents": 0,
    "jquery/no-parse-html": 0,
    "jquery/no-parse-html": 2,
    "jquery/no-prop": 0,
    "jquery/no-proxy": 2,
    "jquery/no-ready": 2,
    ......
    ......
    ......@@ -1333,7 +1333,20 @@
    const settings = response.settings || ajax.settings || drupalSettings;
    // Parse response.data into an element collection.
    let $newContent = $($.parseHTML(response.data, document, true));
    const parseHTML = (htmlString) => {
    const fragment = document.createDocumentFragment();
    // Create a temporary div element
    const tempDiv = fragment.appendChild(document.createElement('div'));
    // Set the innerHTML of the div to the provided HTML string
    tempDiv.innerHTML = htmlString;
    // Return the contents of the temporary div
    return tempDiv.childNodes;
    };
    let $newContent = $(parseHTML(response.data));
    // For backward compatibility, in some cases a wrapper will be added. This
    // behavior will be removed before Drupal 9.0.0. If different behavior is
    // needed, the theme functions can be overridden.
    ......
    ......
    0% Loading or .
    You are about to add 0 people to the discussion. Proceed with caution.
    Please to comment