Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically embeded of class="simple-translate-result" in Wordpress #551

Open
sevdalin opened this issue Oct 25, 2024 · 1 comment
Open

Comments

@sevdalin
Copy link

Hi, I saw you have fixed this issue back in 2019 but appears that the issue is still around and it completely ruined my Wordpress page made with DIVI.

This HTML element:

was spread all over the

tags and everywhere else, so it became complete disaster until I noticed it. No way of removing it because I have to recreate the page.

Please fix this issue!

Workaround which is not very good because of performance overload but nothing else came up to mine mind is:

document.addEventListener('DOMContentLoaded', function() {
    // Select all elements that have "simple-translate" as part of their class name
    const elementsToRemove = document.querySelectorAll('[class*="simple-translate"]');
    
    // Loop through each element
    elementsToRemove.forEach(function(element) {
        // Move the child nodes of the element to its parent before removing the element itself
        while (element.firstChild) {
            element.parentNode.insertBefore(element.firstChild, element);
        }
        // Remove the element itself (without its children)
        element.remove();
    });
});
</script>
@sevdalin
Copy link
Author

The HTML element: p tag with "<class="simple-translate-result" dir="auto">"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant