mirror of
				https://github.com/ggml-org/llama.cpp.git
				synced 2025-11-03 09:22:01 +00:00 
			
		
		
		
	server : do not apply Markdown formatting in code sections (#6850)
This commit is contained in:
		@@ -881,11 +881,11 @@
 | 
			
		||||
        .replace(/&/g, '&')
 | 
			
		||||
        .replace(/</g, '<')
 | 
			
		||||
        .replace(/>/g, '>')
 | 
			
		||||
        .replace(/^#{1,6} (.*)$/gim, '<h3>$1</h3>')
 | 
			
		||||
        .replace(/\*\*(.*?)\*\*/g, '<strong>$1</strong>')
 | 
			
		||||
        .replace(/__(.*?)__/g, '<strong>$1</strong>')
 | 
			
		||||
        .replace(/\*(.*?)\*/g, '<em>$1</em>')
 | 
			
		||||
        .replace(/_(.*?)_/g, '<em>$1</em>')
 | 
			
		||||
        .replace(/(^|\n)#{1,6} ([^\n]*)(?=([^`]*`[^`]*`)*[^`]*$)/g, '$1<h3>$2</h3>')
 | 
			
		||||
        .replace(/\*\*(.*?)\*\*(?=([^`]*`[^`]*`)*[^`]*$)/g, '<strong>$1</strong>')
 | 
			
		||||
        .replace(/__(.*?)__(?=([^`]*`[^`]*`)*[^`]*$)/g, '<strong>$1</strong>')
 | 
			
		||||
        .replace(/\*(.*?)\*(?=([^`]*`[^`]*`)*[^`]*$)/g, '<em>$1</em>')
 | 
			
		||||
        .replace(/_(.*?)_(?=([^`]*`[^`]*`)*[^`]*$)/g, '<em>$1</em>')
 | 
			
		||||
        .replace(/```.*?\n([\s\S]*?)```/g, '<pre><code>$1</code></pre>')
 | 
			
		||||
        .replace(/`(.*?)`/g, '<code>$1</code>')
 | 
			
		||||
        .replace(/\n/gim, '<br />');
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user