mirror of
https://github.com/DanielnetoDotCom/YouPHPTube
synced 2025-10-05 10:49:36 +02:00
Updates
This commit is contained in:
parent
6efee3a800
commit
051401c6fc
803 changed files with 70126 additions and 6014 deletions
25
node_modules/tinymce/plugins/codesample/plugin.js
generated
vendored
25
node_modules/tinymce/plugins/codesample/plugin.js
generated
vendored
|
@ -1,5 +1,5 @@
|
|||
/**
|
||||
* TinyMCE version 6.1.0 (2022-06-29)
|
||||
* TinyMCE version 6.1.2 (2022-07-29)
|
||||
*/
|
||||
|
||||
(function () {
|
||||
|
@ -2363,6 +2363,7 @@
|
|||
const code = elm.textContent;
|
||||
dom.setAttrib(elm, 'class', trim(dom.getAttrib(elm, 'class')));
|
||||
dom.setAttrib(elm, 'contentEditable', null);
|
||||
dom.setAttrib(elm, 'data-mce-highlighted', null);
|
||||
let child;
|
||||
while (child = elm.firstChild) {
|
||||
elm.removeChild(child);
|
||||
|
@ -2374,22 +2375,36 @@
|
|||
editor.on('SetContent', () => {
|
||||
const dom = editor.dom;
|
||||
const unprocessedCodeSamples = global.grep(dom.select('pre'), elm => {
|
||||
return isCodeSample(elm) && elm.contentEditable !== 'false';
|
||||
return isCodeSample(elm) && dom.getAttrib(elm, 'data-mce-highlighted') !== 'true';
|
||||
});
|
||||
if (unprocessedCodeSamples.length) {
|
||||
editor.undoManager.transact(() => {
|
||||
global.each(unprocessedCodeSamples, elm => {
|
||||
var _a;
|
||||
global.each(dom.select('br', elm), elm => {
|
||||
elm.parentNode.replaceChild(editor.getDoc().createTextNode('\n'), elm);
|
||||
dom.replace(editor.getDoc().createTextNode('\n'), elm);
|
||||
});
|
||||
elm.contentEditable = 'false';
|
||||
elm.innerHTML = dom.encode(elm.textContent);
|
||||
elm.innerHTML = dom.encode((_a = elm.textContent) !== null && _a !== void 0 ? _a : '');
|
||||
get(editor).highlightElement(elm);
|
||||
dom.setAttrib(elm, 'data-mce-highlighted', true);
|
||||
elm.className = trim(elm.className);
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
editor.on('PreInit', () => {
|
||||
editor.parser.addNodeFilter('pre', nodes => {
|
||||
var _a;
|
||||
for (let i = 0, l = nodes.length; i < l; i++) {
|
||||
const node = nodes[i];
|
||||
const isCodeSample = ((_a = node.attr('class')) !== null && _a !== void 0 ? _a : '').indexOf('language-') !== -1;
|
||||
if (isCodeSample) {
|
||||
node.attr('contenteditable', 'false');
|
||||
node.attr('data-mce-highlighted', 'false');
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
};
|
||||
|
||||
const isCodeSampleSelection = editor => {
|
||||
|
|
4
node_modules/tinymce/plugins/codesample/plugin.min.js
generated
vendored
4
node_modules/tinymce/plugins/codesample/plugin.min.js
generated
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue