Problem/Motivation

When using the filter_html filter and any of <caption>, <tbody>, <thead>, <tfoot>, <th>, <td>, <tr> tags are used in the "Allowed HTML tags" textarea, when revisiting the form, a javascript error is pops-up:

TypeError: Cannot read property 'tagName' of null in Drupal.behaviors.filterFilterHtmlUpdating

This is because of the following:
Allowed elements can be tag names + attributes. To get just the tag name, a "sandbox" div is used to get the tag name of a given allowed element parsing each allowed element.
The sandbox div
const sandbox = document.createElement('div');
Adding an "allowed tag" to the sandbox, then getting its tag name

sandbox.innerHTML = (the allowed element);
 node = sandbox.firstChild;
        tag = node.tagName.toLowerCase();

This breaks with table-related tag names as browsers do not allow these elements to have a <div> as their immediate parent.

In other words, this has nothing to do with what other tags are allowed, it's because the browser will not allow making a table-related element the direct child of a <div>, so sandbox.firstChild is null in those cases.

Steps to reproduce:

  • Enable filter and editor modules,
  • Create and edit a text format,
  • Enable the Limit allowed HTML tags and correct faulty HTML filter,
  • In the filter settings section, select the Limit allowed HTML tags and correct faulty HTML vertical tab,
  • In the Allowed HTML tags textarea enter one or more of <caption>, <tbody>, <thead>, <tfoot>, <th>, <td>, <tr> tags,
  • Press the Save configuration button,
  • Revisit the form and check the JS console.

The bug is proved by the attached "test only" patch.

Proposed resolution

Fix it.

Remaining tasks

None.

User interface changes

None.

API changes

None.

Data model changes

None.

Original report

I try to add the templates plugin of ckeditor into drupal8 to
achieve this http://knackforge.com/blog/sivaji/leveraging-ckeditor-template-theme-dru...

I created the module and the required files on this location:
git@github.com:baverhey/d8_ckeditor_templates.git

With information of these locations:
http://drupal.stackexchange.com/questions/139075/implementing-ckeditors-...
http://alexcoder.info/en/content/dobavlenie-plagina-ckeditor-v-drupal-8
https://www.youtube.com/watch?feature=player_detailpage&v=h9KV_VRvIG8#t=...
https://github.com/wwalc/moonocolor

There are no errors or any feedback why it is not working.

ckeditor plugin:
Its about the following plugins
http://ckeditor.com/addon/templates

any hints or tips are welcome.

Issue fork drupal-2556069

Command icon Show commands

Start within a Git clone of the project using the version control instructions.

Or, if you do not have SSH keys set up on git.drupalcode.org:

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

ikeigenwijs created an issue. See original summary.

Wim Leers’s picture

Status: Active » Fixed

There are no errors or any feedback why it is not working.

You're basically just saying "it does not work".

Look at CKEditorPluginInterface and all of its implementations. You'll find plenty, plenty of examples that way.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.

ikeigenwijs’s picture

Version: 8.0.0-beta14 » 8.0.0-beta15
Status: Closed (fixed) » Active
FileSize
10.03 KB
14.54 KB

Sorry Wim, i still did not get it to work, its driving me and probably also you nuts.
On 2 different drupal 8.0.15 beta installs.
one clean one with just drupal core, nothing else.
Redid everything on d8.0.x master branche

I started from scratch with 3 different independent ckeditor add ons to enable.
all ckeditor version 4.4.x compatible
widgetbootstrap (the one i actually want) http://ckeditor.com/addon/widgetbootstrap
widgetbootstrap http://ckeditor.com/addon/widgetcommon

error i get with chrome js debugger: in aggregated version
Uncaught TypeError: Cannot read property 'icons' of null(anonymous function) @ ckeditor.js?v=4.4.7:214

(anonymous function) @ ckeditor.js?v=4.4.7:214
CKEDITOR.scriptLoader.load.k @ ckeditor.js?v=4.4.7:209
CKEDITOR.scriptLoader.load.m @ ckeditor.js?v=4.4.7:209
CKEDITOR.scriptLoader.load.q @ ckeditor.js?v=4.4.7:209
(anonymous function) @ ckeditor.js?v=4.4.7:210

used dif to see if i missed something and as proof of concept:
liststyle starting from the addon repository ,compared with liststyle from a drupal con talk these both do not crash ckeditor.

I get the buttons to show for all 3 on the config page, i can add the buttons to the toolbar.
But when editing a page the error occurs.

Following: https://www.drupal.org/node/2480333#comment-9948215
after recompiling ckeditor so i could see the code and use step by step debugger the part it hangs is:
in ckeditor.js line 14522
The first error seems to be related to image2
This is after dropping image2 in the ckeditor plugin folder
CKEDITOR.tools.extend( allPlugins, plugins );

var requiredPlugins = []; value requiredPlugins = ["image2"]
for ( var pluginName in plugins ) { value plugin="drupalimagecaption"
var plugin = plugins[ pluginName ], value plugin = Object {requires: "drupalimage", name: "drupalimagecaption", path: "http://d8_local/core/modules/ckeditor/js/plugins/drupalimagecaptio
requires = plugin && plugin.requires; value requires = "drupalimage"

if ( !initialized[ pluginName ] ) {
// Register all icons eventually defined by this plugin

After dropping image2 (just for testing) in the searched folder it gets bit further a couple of other modules follow. this is only in the recompiled verison i see a difference

drush rebuild-cache as a mad man at every step.
Checked and triple checked the CamelCasing, path, icon names, ... according to some posts, all to no avail.
clean d8 from git

Re tested everything with the 8.0.x branch same errors and results.

A push in the right direction would be much appreciated, its driving me nuts.
I attached the 2 modules

Wim Leers’s picture

Status: Active » Needs work

Please edit your comment so that it becomes at least somewhat legible. I'm pretty sure an ICT manager is able to write better English and better formatted texts than this.

ikeigenwijs’s picture

I will try

Goal

Basic adaptation of widgetbootstrap ckeditor add-on using the CKEditorPluginInterface, CKEditorPluginButtonsInterface;
According to available examples and documentation i found.

Problem

Basic adaptation of widgetbootstrap gives following error on clean default drupal 8 install.

Uncaught TypeError: Cannot read property 'icons' of null(anonymous function) @ ckeditor.js?v=4.4.7:214

Possible causes

  • Required add-on not present
  • Dependencies: widget and display but are available in core ckeditor

Things checked

  • Icons not readable -> chmod 777 on complete install so excluded as cause
  • Tested on beta15 and master branch
  • No listed dependency's on add on page
  • No listed dependency's found on information page or in .js file
  • Tested in full and limited html filter
  • Step by step debugger on unsegregated ckeditor version, followed instructions
  • Rebuild cache at every step
  • Add on compatible with the ckeditor version in drupal core
  • Triple checked the CamelCasing, path, icon names
  • Tryed other add-ons widgetcommon, colorbutton

What works

Assigning the buttons to the ckeditor toolbar with the 'missing' icons showing. No problems what so ever.

Code snippets

The origin of the error in ckeditor aggregated version

(anonymous function) @ ckeditor.js?v=4.4.7:214
CKEDITOR.scriptLoader.load.k @ ckeditor.js?v=4.4.7:209
CKEDITOR.scriptLoader.load.m @ ckeditor.js?v=4.4.7:209
CKEDITOR.scriptLoader.load.q @ ckeditor.js?v=4.4.7:209
(anonymous function) @ ckeditor.js?v=4.4.7:210

The origin of the error in ckeditor unaggregated version

ckeditor.js line 14522

CKEDITOR.tools.extend( allPlugins, plugins );

var requiredPlugins = []; 
for ( var pluginName in plugins ) { 
  var plugin = plugins[ pluginName ], 
  requires = plugin && plugin.requires; 

  if ( !initialized[ pluginName ] ) {
  // Register all icons eventually defined by this plugin
Wim Leers’s picture

Assigned: Unassigned » Wim Leers

Thanks, that's infinitely better :)

I'll try to reproduce & debug locally!

Wim Leers’s picture

Title: Ckeditor enable extra plugin, template plugin » Unable to get a custom CKEditor plugin to load/work: help requested

More accurate title.

Note that I probably won't have time for this until after RC1.

ikeigenwijs’s picture

I'm glad you like it. :D
I ll try some other things but i feel like the unaggregated ckeditor version using the build feature is not the same as the drupal core aggregated version. Is this correct?

Thank you for your time.

kevinquillen’s picture

Version: 8.0.0-beta15 » 8.0.0-rc2

I am also getting this same error. At a minimum I am trying to integrate the optional CodeSnippet module from CKEditor into D8 CKEditor following examples from DrupalImage plugin. I can see the button on the plugin list (also with xdebug) and I can assign it to the active toolbar. However, reloading the page gives me:

"Uncaught TypeError: Cannot read property 'icons' of null"

Everything I have done looks nearly the same as what was done in core to register and display those plugins, yet no dice. The form settings and options are displayed and saved correctly to config, but the Javascript error prevents it from working. Not sure how to rectify this error.

kevinquillen’s picture

I've put my code into a GitHub repository - I have debugged this as many ways as I can find and the same error persists.

https://github.com/kevinquillen/codesnippet

I have seen other modules work successfully, so I don't understand what is generating this error.

Examples:

Granted they are older..

The error appears to be thrown here in ckeditor.js:

for ( var pluginName in plugins ) {
	var plugin = plugins[ pluginName ],
		requires = plugin && plugin.requires;

	if ( !initialized[ pluginName ] ) {
		// Register all icons eventually defined by this plugin.
		if ( plugin.icons ) {
			var icons = plugin.icons.split( ',' );
			for ( var ic = icons.length; ic--; ) {
				CKEDITOR.skin.addIcon( icons[ ic ],
					plugin.path +
					'icons/' +
					( CKEDITOR.env.hidpi && plugin.hidpi ? 'hidpi/' : '' ) +
					icons[ ic ] +
					'.png' );
			}
		}
		initialized[ pluginName ] = 1;
	}

	if ( requires ) {
		// Trasnform it into an array, if it's not one.
		if ( requires.split )
			requires = requires.split( ',' );

		for ( var i = 0; i < requires.length; i++ ) {
			if ( !allPlugins[ requires[ i ] ] )
				requiredPlugins.push( requires[ i ] );
		}
	}
}

However 'icons' is defined in the codesnippet plugin definition - so it would seem that the plugin object here is either missing it or not defined correctly.

I can drag the icon from the toolbar into the active toolbar, and the settings form appears. I can save the form. But the reload of the page, the settings form isn't there, and dragging and dropping the button back on the toolbar makes it appear.

kevinquillen’s picture

Title: Unable to get a custom CKEditor plugin to load/work: help requested » Custom CKEditor plugin causes "Uncaught TypeError: Cannot read property 'icons' of null"
kevinquillen’s picture

Okay, so this is interesting. I just updated to 8.0.0-rc3, in which updating the version of CKEditor occurred.

I no longer get this error:

"Uncaught TypeError: Cannot read property 'icons' of null"

But now, I get this new one:

"Uncaught TypeError: Cannot read property 'tagName' of null"

However, all plugins work, including my custom one - which wasn't before.

Wim Leers’s picture

Status: Needs work » Postponed (maintainer needs more info)

Several CKEditor fixes went in for RC3. One of them included updating CKEditor to version 4.5.4.

Can you please post the stacktrace? Just "Uncaught TypeError: Cannot read property 'tagName' of null" is pretty much useless. We need to know where that error is thrown. Thanks!

esclapes’s picture

Title: Custom CKEditor plugin causes "Uncaught TypeError: Cannot read property 'icons' of null" » caption element throws TypeError: Cannot read property 'tagName' of null in Drupal.behaviors.filterFilterHtmlUpdating
Status: Postponed (maintainer needs more info) » Active

I found the same error and this is what I found (BTW,I am not sure if this should be its own issue).

It seems to be a problem with Drupal.behaviors.filterFilterHtmlUpdating._parseSetting whent trying to parse the <caption> tag, for some reason sandbox.firstChild returns null.

This is the stack trace

Uncaught TypeError: Cannot read property 'tagName' of null
    Drupal.behaviors.filterFilterHtmlUpdating._parseSetting @ filter.filter_html.admin.js?v=8.0.0:245
   (anonymous function) @ filter.filter_html.admin.js?v=8.0.0:76
   n.extend.each @ jquery.js:374
   n.fn.n.each @ jquery.js:139
   Drupal.behaviors.filterFilterHtmlUpdating.attach @ filter.filter_html.admin.js?v=8.0.0:73
   Drupal.attachBehaviors @ drupal.js?v=8.0.0:168
   (anonymous function) @ drupal.js?v=8.0.0:178
   n.addEventListener.t @ ready.min.js?v=1.0.8:4
Wim Leers’s picture

Status: Active » Postponed (maintainer needs more info)

Can you reproduce this with 8.0.1?

esclapes’s picture

Status: Postponed (maintainer needs more info) » Closed (cannot reproduce)

No, I cannot reproduce on a fresh install of 8.0.1

Tim Bozeman’s picture

Status: Closed (cannot reproduce) » Needs work

I'm on Drupal 8.0.4 and #15 seems to have resurfaced. If I add a CKEditor plugin and go to /admin/config/content/formats/manage/full_html I get a JS error.
Uncaught TypeError: Cannot read property 'tagName' of null
Same thing as #15 describes filter.filter_html.admin.js line 243.
sandbox.innerHTML = allowedTags[t];
When allowedTags[t] is "<caption>" innerHTML returns "" which makes node.tagName.toLowerCase() fail.

Wim Leers’s picture

Version: 8.0.0-rc2 » 8.0.x-dev
Assigned: Wim Leers » Unassigned
Category: Support request » Bug report
Priority: Normal » Minor

This is for now only affecting few people, so I won't have time for it soon probably. If you can work on a patch, this will get fixed much faster of course :)

Tim Bozeman’s picture

Status: Needs work » Needs review
FileSize
1.48 KB

The problem is that we are adding table tags e.g. caption, tbody, thead, tfoot, th, td, tr without a table. Here's a first pass at a patch.

Version: 8.0.x-dev » 8.1.x-dev

Drupal 8.0.6 was released on April 6 and is the final bugfix release for the Drupal 8.0.x series. Drupal 8.0.x will not receive any further development aside from security fixes. Drupal 8.1.0-rc1 is now available and sites should prepare to update to 8.1.0.

Bug reports should be targeted against the 8.1.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.2.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.1.x-dev » 8.2.x-dev

Drupal 8.1.9 was released on September 7 and is the final bugfix release for the Drupal 8.1.x series. Drupal 8.1.x will not receive any further development aside from security fixes. Drupal 8.2.0-rc1 is now available and sites should prepare to upgrade to 8.2.0.

Bug reports should be targeted against the 8.2.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.3.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

Version: 8.2.x-dev » 8.3.x-dev

Drupal 8.2.6 was released on February 1, 2017 and is the final full bugfix release for the Drupal 8.2.x series. Drupal 8.2.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.3.0 on April 5, 2017. (Drupal 8.3.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.3.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.4.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

rutiolma’s picture

Version: 8.3.x-dev » 8.4.x-dev
Status: Needs review » Reviewed & tested by the community

Still getting this error on 8.4.x-dev and this patch fixes it.

tstoeckler’s picture

Status: Reviewed & tested by the community » Needs work

ESlint complains about the latest patch:

core/modules/filter/filter.filter_html.admin.js
line 246	Expected '===' and instead saw '=='. (eqeqeq)
251	Strings must use singlequote. (quotes)
claudiu.cristea’s picture

Version: 8.4.x-dev » 8.3.x-dev
Status: Needs work » Needs review
FileSize
1.49 KB
957 bytes

Fixing the ESLint issues. And being an ugly bug, it should go in 8.3.x.

Status: Needs review » Needs work

The last submitted patch, 26: 2556069-26.patch, failed testing. View results

claudiu.cristea’s picture

FileSize
957 bytes
1.49 KB
claudiu.cristea’s picture

Status: Needs work » Needs review
tstoeckler’s picture

Status: Needs review » Reviewed & tested by the community

Thanks! Re-RTBCing per #24.

jibran’s picture

Priority: Minor » Normal

Status: Reviewed & tested by the community » Needs work

The last submitted patch, 28: 2556069-28.patch, failed testing. View results

claudiu.cristea’s picture

Looks unrelated?

claudiu.cristea’s picture

Status: Needs work » Reviewed & tested by the community
star-szr’s picture

Version: 8.3.x-dev » 8.5.x-dev
Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs issue summary update

Steps to reproduce in the issue summary would be great. Should this have a test or is that overkill?

Only criticals are going into 8.3.x so bumping up to 8.5.x and this could potentially be backported to 8.4.x. Looks like this patch needs to be reworked for ES6.

Robertliu’s picture

@claudiu.cristea #26
Thank you. That fixed this error.

pfrenssen’s picture

Version: 8.5.x-dev » 8.4.x-dev
Issue tags: +Needs reroll

It's a bugfix so 8.4.x is still a valid target for this. This needs to be rerolled, it conflicts with the coding standards fixes that were done in #2880007: Auto-fix ESLint errors and warnings.

pfrenssen’s picture

Status: Needs work » Needs review
Issue tags: -Needs reroll
FileSize
2.95 KB

It was actually the change to ES6 that caused the conflict. Rerolled it, my first time working with ES6 :)

I wasn't able to generate an interdiff since it was faster to apply the changes manually rather than rebase on the pre-ES6 code base, but the one line that I changed was this:

-      var currentTag;
+      let currentTag;

And moved the code to the ES6 file + regenerated the fallback JS.

Version: 8.4.x-dev » 8.5.x-dev

Drupal 8.4.4 was released on January 3, 2018 and is the final full bugfix release for the Drupal 8.4.x series. Drupal 8.4.x will not receive any further development aside from critical and security fixes. Sites should prepare to update to 8.5.0 on March 7, 2018. (Drupal 8.5.0-alpha1 is available for testing.)

Bug reports should be targeted against the 8.5.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.6.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

dimr’s picture

Status: Needs review » Reviewed & tested by the community

I have tried the patch #38 and it solved my problem.

alexpott’s picture

Status: Reviewed & tested by the community » Needs work
Issue tags: +Needs tests

Looks like we have missing test coverage. In order to commit a bug fix we need an automated to test to prove that we've fixed the bug and ensure that we don't break it again in the future. For more information about writing tests in Drupal 8 see the following links:

  1. https://www.drupal.org/docs/8/testing
  2. https://api.drupal.org/api/drupal/core%21core.api.php/group/testing/8.5.x
superlolo95’s picture

+1 for #38

Version: 8.5.x-dev » 8.6.x-dev

Drupal 8.5.6 was released on August 1, 2018 and is the final bugfix release for the Drupal 8.5.x series. Drupal 8.5.x will not receive any further development aside from security fixes. Sites should prepare to update to 8.6.0 on September 5, 2018. (Drupal 8.6.0-rc1 is available for testing.)

Bug reports should be targeted against the 8.6.x-dev branch from now on, and new development or disruptive changes should be targeted against the 8.7.x-dev branch. For more information see the Drupal 8 minor version schedule and the Allowed changes during the Drupal 8 release cycle.

claudiu.cristea’s picture

Here's the 'test only" patch.

claudiu.cristea’s picture

Status: Needs work » Needs review
claudiu.cristea’s picture

Title: caption element throws TypeError: Cannot read property 'tagName' of null in Drupal.behaviors.filterFilterHtmlUpdating » Table elements w/o table tag used in allowed HTML tags throws JS error
Issue summary: View changes
Issue tags: -Needs issue summary update
FileSize
4.41 KB

The full patch. The interdiff is the patch from #44.

claudiu.cristea’s picture

Title: Table elements w/o table tag used in allowed HTML tags throws JS error » Table elements w/o table tag used in "allowed HTML tags" are throwing a JS error

The last submitted patch, 44: 2556069-44.test-only.patch, failed testing. View results

NickDickinsonWilde’s picture

Status: Needs review » Reviewed & tested by the community

Manually tested that the fix works. Test looks okay to me too.

lauriii’s picture

Status: Reviewed & tested by the community » Needs review
Issue tags: +Needs subsystem maintainer review

Can we get a review from the subsystem maintainers for the approach taken here?

BarisW’s picture

Can we get this in?

rromore’s picture

I can confirm that this is still an issue as of 8.7.3 and that #46 works for 8.7.3. The patch addresses the problem for the following tags: caption, tbody, thead, tfoot, th, td, and tr. However functionality is still broken for the following table-related tags: colgroup, col.

lukus’s picture

I can confirm same for drupal/core (8.7.7) and #46.

claudiu.cristea’s picture

Version: 8.6.x-dev » 8.8.x-dev
claudiu.cristea’s picture

claudiu.cristea’s picture

Assigned: Unassigned » Wim Leers

This is marked as "Needs subsystem maintainer review" since October 2018, I'll assign to @Wim Leers for a feedback.

pfrenssen’s picture

Changes made look good, just formatting fixes and adding the admin theme. Still needs maintainer review, so not setting to RTBC.

Version: 8.8.x-dev » 8.9.x-dev

Drupal 8.8.7 was released on June 3, 2020 and is the final full bugfix release for the Drupal 8.8.x series. Drupal 8.8.x will not receive any further development aside from security fixes. Sites should prepare to update to Drupal 8.9.0 or Drupal 9.0.0 for ongoing support.

Bug reports should be targeted against the 8.9.x-dev branch from now on, and new development or disruptive changes should be targeted against the 9.1.x-dev branch. For more information see the Drupal 8 and 9 minor version schedule and the Allowed changes during the Drupal 8 and 9 release cycles.

kevin.pfeifer’s picture

I first created a duplicate Issue because I couldn't find this one (https://www.drupal.org/project/drupal/issues/3173615) but I can confirm, that the Patch from #56 fixed my problem!

claudiu.cristea’s picture

Issue tags: +JavaScript
marcvangend’s picture

Here's a re-roll of the patch from #56 against Drupal core 9.1.x.

Wim Leers’s picture

Apologies for the long, long silence on this issue!

Special thanks to @claudiu.cristea for getting this issue back on track and completely overhauling the issue summary in #46 🙏

Test coverage looks great 👍

lauriii’s picture

Version: 8.9.x-dev » 9.2.x-dev
lauriii’s picture

Status: Reviewed & tested by the community » Needs review
FileSize
1.54 KB
686 bytes

I'm wondering if the issue summary is correct because I could reproduce the problem even when

element is listed there. I applied a test only patch to try to prove that. I'm also wondering if we should allow adding elements to the list that are only permitted inside <table>, when <table> is not allowed 🤔

Status: Needs review » Needs work

The last submitted patch, 65: 2556069-65-test-only.patch, failed testing. View results

Proteo’s picture

Tested patch in #62 on Drupal 9.1.5, it works and solves the issue.

Version: 9.2.x-dev » 9.3.x-dev

Drupal 9.2.0-alpha1 will be released the week of May 3, 2021, which means new developments and disruptive changes should now be targeted for the 9.3.x-dev branch. For more information see the Drupal core minor version schedule and the Allowed changes during the Drupal core release cycle.

bnjmnm made their first commit to this issue’s fork.

bnjmnm’s picture

Issue summary: View changes
Status: Needs work » Needs review

Added MR and set to needs review - the test failure that switched this to needs work was intentional.

Updated the issue summary to make it clear that configured allowed tags are not the issue, but appending elements to a <div> that semantically can't have a <div> as its immediate parent.

The solution in #62 will fail if the configured tags have attributes. It only works if the tag and nothing else is provided, which defeats the purpose as the purpose of that code is to extract the tag name from an item with attributes.

I changed this to use a jQuery solution, which despite jQuery's reputation seems to be the most effective way to do it. A jQuery object can accept an argument of a tag with attributes, and doesn't need a parent element. Once created, the tag name can be parsed easily.

nod_’s picture

Assigned: Wim Leers » Unassigned
Status: Needs review » Reviewed & tested by the community

I agree that jQuery is a good solution here. It's purpose is to make life easier in those type of situations.

Code in the MR fixes the problem, there is a test, and a comment to explain why jquery is used.

The point in #65 about allowing table element when table is not allowed makes sense, follow-up feature request though :)

bnjmnm’s picture

Title: Table elements w/o table tag used in "allowed HTML tags" are throwing a JS error » JS error with elements in "allowed HTML tags" that can't be direct descendants of a div

  • lauriii committed 88498c7 on 9.3.x
    Issue #2556069 by claudiu.cristea, bnjmnm, lauriii, pfrenssen, Tim...
lauriii’s picture

Version: 9.3.x-dev » 9.2.x-dev

Committed 88498c7 and pushed to 9.3.x. Thanks!

Leaving open for potential backport to 9.2.x.

lauriii’s picture

Posting patch to run tests against 9.2.x

  • lauriii committed 9e96d1c on 9.2.x
    Issue #2556069 by claudiu.cristea, bnjmnm, lauriii, pfrenssen, Tim...
lauriii’s picture

Status: Reviewed & tested by the community » Fixed

Backported to 9.2.x based on @xjm, @effulgentsia, and @alexpott providing +1 for the backport on Slack.

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.