Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the issue happens on plugin codesample when i use tinymce in a project with nuxt3+vite #9550

Open
yellowtree8 opened this issue Apr 11, 2024 · 0 comments

Comments

@yellowtree8
Copy link

there is an error said globalthis.grep is not a function.looking the js file in browser,i find that in the plugin,js of codesample,a sentence var global = tinymce.util.Tools.resolve('tinymce.util.Tools'); and then it was user with
global.each(global.grep(pres, isCodeSample), elm => {
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);
}
const codeElm = dom.add(elm, 'code');
codeElm.textContent = code;
});

here ,the global was replaced by globalthis in browser,maybe when build or prebuild,something happen and regard global as a keyword and replace it to suit the nodejs and browser.
how can i do to prevent the replace

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant