// Copyright 2024 The Gitea Authors. All rights reserved. // SPDX-License-Identifier: MIT package markup import ( "testing" "github.com/stretchr/testify/assert" ) func TestDescriptionSanitizer(t *testing.T) { testCases := []string{ `

Title

`, `Title`, `image`, ``, `THUMBS UP`, `THUMBS UP`, `Hello World`, `Hello World`, `
`, ``, `https://example.com`, `https://example.com`, `data`, `data`, `Important!`, `Important!`, `
Click me! Nothing to see here.
`, `Click me! Nothing to see here.`, ``, ``, `I have a strong opinion about this.`, `I have a strong opinion about this.`, `Provides alternative wg(8) tool`, `Provides alternative wg(8) tool`, } for i := 0; i < len(testCases); i += 2 { assert.Equal(t, testCases[i+1], SanitizeDescription(testCases[i])) } }