Merge branch 'sliortega295-ops-fix-issue-2216' into staging

This commit is contained in:
yflory 2026-05-06 13:16:07 +02:00
commit bec4246729

View File

@ -728,13 +728,21 @@ define([
var href = el.getAttribute('href');
if (/^#/.test(href)) {
try {
var foundAnchor = false;
$inner.find('.cke_anchor[data-cke-realelement]').each(function (j, el) {
if (foundAnchor) { return; }
var i = editor.restoreRealElement($(el));
var node = i.$;
if (node.id === href.slice(1)) {
el.scrollIntoView();
foundAnchor = true;
}
});
// Fallback: try to find anchor by ID directly
if (!foundAnchor) {
var anchorsById = $inner.find('#' + href.slice(1));
if (anchorsById.length) { anchorsById[0].scrollIntoView(); }
}
} catch (err) {}
return;
}