mirror of
				https://github.com/go-gitea/gitea
				synced 2025-11-03 21:08:25 +00:00 
			
		
		
		
	Refactor markup render system (#32533)
Remove unmaintainable sanitizer rules. No need to add special "class" regexp rules anymore, use RenderInternal.SafeAttr instead, more details (and examples) are in the tests
This commit is contained in:
		@@ -19,7 +19,6 @@ func TestSanitizer(t *testing.T) {
 | 
			
		||||
		// Code highlighting class
 | 
			
		||||
		`<code class="random string"></code>`, `<code></code>`,
 | 
			
		||||
		`<code class="language-random ui tab active menu attached animating sidebar following bar center"></code>`, `<code></code>`,
 | 
			
		||||
		`<code class="language-go"></code>`, `<code class="language-go"></code>`,
 | 
			
		||||
 | 
			
		||||
		// Input checkbox
 | 
			
		||||
		`<input type="hidden">`, ``,
 | 
			
		||||
@@ -38,10 +37,8 @@ func TestSanitizer(t *testing.T) {
 | 
			
		||||
		// <kbd> tags
 | 
			
		||||
		`<kbd>Ctrl + C</kbd>`, `<kbd>Ctrl + C</kbd>`,
 | 
			
		||||
		`<i class="dropdown icon">NAUGHTY</i>`, `<i>NAUGHTY</i>`,
 | 
			
		||||
		`<i class="icon dropdown"></i>`, `<i class="icon dropdown"></i>`,
 | 
			
		||||
		`<input type="checkbox" disabled=""/>unchecked`, `<input type="checkbox" disabled=""/>unchecked`,
 | 
			
		||||
		`<span class="emoji dropdown">NAUGHTY</span>`, `<span>NAUGHTY</span>`,
 | 
			
		||||
		`<span class="emoji">contents</span>`, `<span class="emoji">contents</span>`,
 | 
			
		||||
 | 
			
		||||
		// Color property
 | 
			
		||||
		`<span style="color: red">Hello World</span>`, `<span style="color: red">Hello World</span>`,
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user