mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-04 05:18:25 +00: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>`);
 | 
						|
});
 |