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:
parent
4f879a00df
commit
8a20fba8eb
42 changed files with 568 additions and 508 deletions
|
@ -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>`,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue