mirror of
				https://github.com/BookStackApp/BookStack.git
				synced 2025-11-04 13:31:45 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			16 lines
		
	
	
		
			379 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			16 lines
		
	
	
		
			379 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
import {Component} from "./component";
 | 
						|
 | 
						|
export class CodeHighlighter extends Component{
 | 
						|
 | 
						|
    setup() {
 | 
						|
        const container = this.$el;
 | 
						|
 | 
						|
        const codeBlocks = container.querySelectorAll('pre');
 | 
						|
        if (codeBlocks.length > 0) {
 | 
						|
            window.importVersioned('code').then(Code => {
 | 
						|
               Code.highlightWithin(container);
 | 
						|
            });
 | 
						|
        }
 | 
						|
    }
 | 
						|
 | 
						|
} |