Skip to content

Commit e28b4f0

Browse files
Kirill Saksinjoshgoebel
authored andcommitted
[pkg] Fix to be able to minify with closure compiler. (#2305)
- Call addEventListener on window instead of the global scope - Fix to be able to minify with closure compiler.
1 parent dc5cefb commit e28b4f0

2 files changed

Lines changed: 4 additions & 2 deletions

File tree

CHANGES.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ Improvements:
3434
- fix(objectivec): Fix various preprocessor highlighting issues (#2265) [David Benjamin][]
3535
- fix(objectivec): Handle multibyte character literals (#2268) [David Benjamin][]
3636
- enh(cpp): Add additional keywords (#2289) [Adrian Ostrowski][]
37+
- fix(pkg): Prefix global addEventListener with window to be able to minify with closure compiler (#2305) [Kirill Saksin]()
3738

3839
[Josh Goebel]: https://github.com/yyyc514
3940
[Liam Nobel]: https://github.com/liamnobel
@@ -44,6 +45,7 @@ Improvements:
4445
[Chris Marchesi]: https://github.com/vancluever
4546
[Adrian Ostrowski]: https://github.com/aostrowski
4647
[Rongjian Zhang]: https://github.com/pd4d10
48+
[Kirill Saksin]: https://github.com/saksmt
4749

4850

4951
## Version 9.16.2

src/highlight.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -926,8 +926,8 @@ https://highlightjs.org/
926926
Attaches highlighting to the page load event.
927927
*/
928928
function initHighlightingOnLoad() {
929-
addEventListener('DOMContentLoaded', initHighlighting, false);
930-
addEventListener('load', initHighlighting, false);
929+
window.addEventListener('DOMContentLoaded', initHighlighting, false);
930+
window.addEventListener('load', initHighlighting, false);
931931
}
932932

933933
var PLAINTEXT_LANGUAGE = { disableAutodetect: true };

0 commit comments

Comments
 (0)