@@ -469,7 +469,7 @@ func Test_ParseClusterFuzz(t *testing.T) {
469
469
assert .NotContains (t , res .String (), "<html" )
470
470
}
471
471
472
- func TestPostProcess_RenderDocument (t * testing.T ) {
472
+ func TestPostProcess (t * testing.T ) {
473
473
setting .StaticURLPrefix = markup .TestAppURL // can't run standalone
474
474
defer testModule .MockVariableValue (& markup .RenderBehaviorForTesting .DisableAdditionalAttributes , true )()
475
475
@@ -480,7 +480,7 @@ func TestPostProcess_RenderDocument(t *testing.T) {
480
480
assert .Equal (t , strings .TrimSpace (expected ), strings .TrimSpace (res .String ()))
481
481
}
482
482
483
- // Issue index shouldn't be post processing in a document.
483
+ // Issue index shouldn't be post- processing in a document.
484
484
test (
485
485
"#1" ,
486
486
"#1" )
@@ -490,7 +490,7 @@ func TestPostProcess_RenderDocument(t *testing.T) {
490
490
"go-gitea/gitea#12345" ,
491
491
`<a href="/go-gitea/gitea/issues/12345" class="ref-issue">go-gitea/gitea#12345</a>` )
492
492
493
- // Test that other post processing still works.
493
+ // Test that other post- processing still works.
494
494
test (
495
495
":gitea:" ,
496
496
`<span class="emoji" aria-label="gitea"><img alt=":gitea:" src="` + setting .StaticURLPrefix + `/assets/img/emoji/gitea.png"/></span>` )
@@ -499,6 +499,12 @@ func TestPostProcess_RenderDocument(t *testing.T) {
499
499
`Some text with <span class="emoji" aria-label="grinning face with smiling eyes">😄</span> in the middle` )
500
500
test ("http://localhost:3000/person/repo/issues/4#issuecomment-1234" ,
501
501
`<a href="http://localhost:3000/person/repo/issues/4#issuecomment-1234" class="ref-issue">person/repo#4 (comment)</a>` )
502
+
503
+ // special tags, GitHub's behavior, and for unclosed tags, output as text content as much as possible
504
+ test ("<script>a" , `<script>a` )
505
+ test ("<script>a</script>" , `<script>a</script>` )
506
+ test ("<STYLE>a" , `<STYLE>a` )
507
+ test ("<style>a</STYLE>" , `<style>a</STYLE>` )
502
508
}
503
509
504
510
func TestIssue16020 (t * testing.T ) {
0 commit comments