mirror of
				https://codeberg.org/yeentown/barkey.git
				synced 2025-10-26 19:14:12 +00:00 
			
		
		
		
	Add block comment support
This commit is contained in:
		
							parent
							
								
									427dd7af18
								
							
						
					
					
						commit
						d548f128d9
					
				
					 1 changed files with 10 additions and 0 deletions
				
			
		|  | @ -101,6 +101,16 @@ const elements = [ | ||||||
| 		}; | 		}; | ||||||
| 	}, | 	}, | ||||||
| 
 | 
 | ||||||
|  | 	// block comment
 | ||||||
|  | 	code => { | ||||||
|  | 		const match = code.match(/^\/\*([\s\S]+?)\*\//); | ||||||
|  | 		if (!match) return null; | ||||||
|  | 		return { | ||||||
|  | 			html: `<span class="comment">${escape(match[0])}</span>`, | ||||||
|  | 			next: match[0].length | ||||||
|  | 		}; | ||||||
|  | 	}, | ||||||
|  | 
 | ||||||
| 	// string
 | 	// string
 | ||||||
| 	code => { | 	code => { | ||||||
| 		if (!/^['"`]/.test(code)) return null; | 		if (!/^['"`]/.test(code)) return null; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		
		Reference in a new issue