mirror of
				https://gitee.com/gitea/gitea
				synced 2025-11-04 16:40:24 +08:00 
			
		
		
		
	* Fix syntax highlight initialization Previously hljs was initialized via a function that relies on the DOMContentLoaded event, registerd after jQuery's 'ready' event. I assume that with the recent jQuery update, DOMContentLoaded may not be guaranteed to fire after 'ready'. Fixed this via vanilla JS initalization. Fixes: https://github.com/go-gitea/gitea/issues/7559 * semicolon
This commit is contained in:
		@@ -1974,7 +1974,10 @@ $(document).ready(function () {
 | 
			
		||||
 | 
			
		||||
    // Highlight JS
 | 
			
		||||
    if (typeof hljs != 'undefined') {
 | 
			
		||||
        hljs.initHighlightingOnLoad();
 | 
			
		||||
        const nodes = [].slice.call(document.querySelectorAll('pre code') || []);
 | 
			
		||||
        for (let i = 0; i < nodes.length; i++) {
 | 
			
		||||
            hljs.highlightBlock(nodes[i]);
 | 
			
		||||
        }
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    // Dropzone
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user