You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a recurrent bug I encounter in the editor, that I solve by a manual editing of the markdown :
When pasting a content (ex : a table coming from LibreOffice), columns of the table become not resizable.
I discover two mechanisms that can explain that :
First, there may have (sometimes) some "width" attribute created (or pasted ?) directly in the <td>, wich conflict with the "style" attribute that TinyMCE is supposed to manage in order to let the user to resize the columns in the editor (TinyMCE defines dynamic width for <td>, in percent, and the "width" attribute contradict the percentage). This result in rigid columns in the editor, wether we try to move them. Strangely, I don't manage to reproduce the bug with the same table I copied from the same file. It seems that the bug depends on non-predictible actions, like : do we create a blank table before pasting, what's the number of rows of the blank table (is it the exact same number), etc... But for sure, I had to delete some "width" attribute in order to fix the bug.
Even by removing all the "width" HTML attributes, the bug persist if we don't add this to the "style" attribute : table-layout: fixed;. It's a CSS property that change the algorithm used by browsers for dynamically calculating the rows/columns of a table. When added to a CSS sheet, it works for the generated page but not for the editor ; thus, it is absolutely necessary to manually add it to the HTML <table> tag in the markdown.
Also, I noticed that sometime, for the plugin config to be correctly applied (all the filters supposed to rewrite the code), I need to save at least two or three times the page to have a correctly rewritten HTML.
Now, for fixing this, I looked at the plugin YAML and TinyMCE content filters in order to find a solution.
Here's what I actually have (and wich is not enough) to "filter" the HTML elements :
As you can see, I rewritten the <td> and limited it in order to wipe any "width" or "height" HTML attribute in it. But it's not enough, and sometimes, the "width" attribute reapears. It may be due to the mechanism n°3 I talked about.
I will test some other restrictions, like :
-
name: invalid_elements
value: 'td[width]'
But I'm not sure that this filter accept these kind of options.
Goals for fixing the bug
Find the correct set of filters in the plugin's config in order to remove any "width" attribute in <td> and <th>.
Automatically add table-layout: fixed; in the style="" attribute of the table, in the TinyMCE editor. This has to be done by the plugin directly (so it implies a fix/patch).
The text was updated successfully, but these errors were encountered:
Here's a recurrent bug I encounter in the editor, that I solve by a manual editing of the markdown :
First, there may have (sometimes) some "width" attribute created (or pasted ?) directly in the
<td>
, wich conflict with the "style" attribute that TinyMCE is supposed to manage in order to let the user to resize the columns in the editor (TinyMCE defines dynamic width for<td>
, in percent, and the "width" attribute contradict the percentage). This result in rigid columns in the editor, wether we try to move them. Strangely, I don't manage to reproduce the bug with the same table I copied from the same file. It seems that the bug depends on non-predictible actions, like : do we create a blank table before pasting, what's the number of rows of the blank table (is it the exact same number), etc... But for sure, I had to delete some "width" attribute in order to fix the bug.Even by removing all the "width" HTML attributes, the bug persist if we don't add this to the "style" attribute :
table-layout: fixed;
. It's a CSS property that change the algorithm used by browsers for dynamically calculating the rows/columns of a table. When added to a CSS sheet, it works for the generated page but not for the editor ; thus, it is absolutely necessary to manually add it to the HTML<table>
tag in the markdown.Also, I noticed that sometime, for the plugin config to be correctly applied (all the filters supposed to rewrite the code), I need to save at least two or three times the page to have a correctly rewritten HTML.
Now, for fixing this, I looked at the plugin YAML and TinyMCE content filters in order to find a solution.
Here's what I actually have (and wich is not enough) to "filter" the HTML elements :
As you can see, I rewritten the
<td>
and limited it in order to wipe any "width" or "height" HTML attribute in it. But it's not enough, and sometimes, the "width" attribute reapears. It may be due to the mechanism n°3 I talked about.I will test some other restrictions, like :
But I'm not sure that this filter accept these kind of options.
Goals for fixing the bug
<td>
and<th>
.table-layout: fixed;
in thestyle=""
attribute of the table, in the TinyMCE editor. This has to be done by the plugin directly (so it implies a fix/patch).The text was updated successfully, but these errors were encountered: