FilterHtml leaves unclosed tags inside inline scripts

Created on 27 October 2016, almost 8 years ago
Updated 5 November 2023, 12 months ago

Hi. It seems there is a problem with javascript filtering. Steps to reproduce:

1.- New Drupal 8.1.10 installation with standard profile (also fails with 8.2.x tested in simplytest.me).
2.- Edit Basic HTML filter and adds <script type> to allowed HTML tags.
3.- Add a new basic page node, and set the following code in HTML Source mode:

<script type="text/javascript">
document.write('<p>This is a <a href="http://www.drupal.org/">test</a></p>');
document.write('<p>This is a <a href="http://www.drupal.org/">test</a></p>');
</script>

4.- After saving the node, Drupal generates the HTML you can see in the attached screenshot.

🐛 Bug report
Status

Needs work

Version

11.0 🔥

Component
Filter 

Last updated about 9 hours ago

No maintainer
Created by

🇪🇸Spain skuark

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024