Closed seuliang closed 5 years ago
Yes, it does. Because here https://github.com/michael-brade/LaTeX.js/blob/1f70d80d961d1fe7d62fbb8497f71c79702df8a7/src/html-generator.ls#L17-L19 you can see that svgdom is only used if the traditional DOM is not available, i.e., we are not running in a browser.
Thank you.
but there is no buildin variable named "global" in JS, how to check "global.window"?
Well, you are right - partly. NodeJS has global
, browsers have window
. And the new thing is globalThis
. I can use global
here without browsers complaining because rollup takes the NodeJS code and transforms it into browser-compatible code. It effectively becomes:
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
form code el = document.createElement type in html-generator.ls , i realized that the dom definition used here is from svgdom, is it right ?
i want to know does traditional javascript dom api work here?