Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 9 additions & 2 deletions scripts/h5peditor-html.js
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,15 @@ ns.Html.prototype.appendTo = function ($wrapper) {
// Remove overflow protection on startup
let initialData = editor.getData();
if (initialData.includes('table-overflow-protection')) {
initialData = initialData.replace(/<div class=\"table-overflow-protection\">.*<\/div>/, '');
editor.setData(initialData);
const match = initialData.match(/<div class="table-overflow-protection">(.*?)<\/div>/);
if (match && match[0]) {
// Set the editor data to just the content of the table-overflow-protection div
editor.setData(match[0]);
} else {
// If no match is found, remove the external div
initialData = initialData.replace(/<div class="table-overflow-protection">.*?<\/div>/, '');
editor.setData(initialData);
}
}

// Mimic old enter_mode behaviour if not specifically set to 'p'
Expand Down