mirror of
				https://github.com/go-gitea/gitea.git
				synced 2025-10-31 03:02:14 +01:00 
			
		
		
		
	
		
			
				
	
	
		
			9 lines
		
	
	
		
			363 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
			
		
		
	
	
			9 lines
		
	
	
		
			363 B
		
	
	
	
		
			TypeScript
		
	
	
	
	
	
| import {html, htmlEscape, htmlRaw} from './html.ts';
 | |
| 
 | |
| test('html', async () => {
 | |
|   expect(html`<a>${'<>&\'"'}</a>`).toBe(`<a><>&'"</a>`);
 | |
|   expect(html`<a>${htmlRaw('<img>')}</a>`).toBe(`<a><img></a>`);
 | |
|   expect(html`<a>${htmlRaw`<img ${'&'}>`}</a>`).toBe(`<a><img &></a>`);
 | |
|   expect(htmlEscape(`<a></a>`)).toBe(`<a></a>`);
 | |
| });
 |