-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Closed
Milestone
Description
This is due to cell range handling added to help clear formatting:
BookStack/resources/js/wysiwyg/fixes.js
Lines 92 to 103 in c290d01
// TinyMCE does not seem to do a great job on clearing styles in complex | |
// scenarios (like copied word content) when a range of table cells | |
// are selected. Here we watch for clear formatting events, so some manual | |
// cleanup can be performed. | |
const attrsToRemove = ['class', 'style', 'width', 'height']; | |
editor.on('FormatRemove', () => { | |
for (const cell of selectedCells) { | |
for (const attr of attrsToRemove) { | |
cell.removeAttribute(attr); | |
} | |
} | |
}); |
The FormatRemove
event is much wider than just format clearing calls, This is also fired on un-toggle of formats (bold, italic etc..) and format changes (alignment changes etc...). This needs to be better scoped to only action upon format remove button presses (Might need custom button action).