mirror of
				https://github.com/zadam/trilium.git
				synced 2025-10-31 03:29:02 +01:00 
			
		
		
		
	fix(client/syntax_highlighting): avoid crash if language not found
This commit is contained in:
		
							parent
							
								
									95987d474d
								
							
						
					
					
						commit
						f36535d061
					
				| @ -61,7 +61,11 @@ export async function applySingleBlockSyntaxHighlight($codeBlock: JQuery<HTMLEle | ||||
|         highlightedText = highlightAuto(text); | ||||
|     } else if (normalizedMimeType) { | ||||
|         await ensureMimeTypesForHighlighting(normalizedMimeType); | ||||
|         highlightedText = highlight(text, { language: normalizedMimeType }); | ||||
|         try { | ||||
|             highlightedText = highlight(text, { language: normalizedMimeType }); | ||||
|         } catch (e) { | ||||
|             console.warn("Unable to apply syntax highlight.", e); | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     if (highlightedText) { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user
	 Elian Doran
						Elian Doran