inital commit

This commit is contained in:
2026-01-01 15:25:19 +05:30
commit f0ae49465a
36361 changed files with 4894111 additions and 0 deletions

View File

@@ -0,0 +1,29 @@
/*!
* Jodit Editor (https://xdsoft.net/jodit/)
* Released under MIT see LICENSE.txt in the project root for license information.
* Copyright (c) 2013-2025 Valeriy Chupurnov. All rights reserved. https://xdsoft.net
*/
import * as consts from "../../../core/constants.js";
import { Dom } from "../../../core/dom/dom.js";
/**
* Finds a suitable parent block container
* @private
*/
export function getBlockWrapper(fake, jodit, tagReg = consts.IS_BLOCK) {
let node = fake;
const root = jodit.editor;
do {
if (!node || node === root) {
break;
}
if (tagReg.test(node.nodeName)) {
if (Dom.isLeaf(node)) {
return node;
}
return (getBlockWrapper(node.parentNode, jodit, /^li$/i) ||
node);
}
node = node.parentNode;
} while (node && node !== root);
return null;
}