summaryrefslogtreecommitdiffstats
path: root/modules/markup/markdown/renderconfig_test.go
diff options
context:
space:
mode:
authorzeripath <art27@cantab.net>2022-10-05 19:55:36 +0100
committerGitHub <noreply@github.com>2022-10-05 19:55:36 +0100
commit93df41f506fb0c3ca897def5d62abaedc93323d8 (patch)
treec4781b3570c5c191c6249914b03228a3d9185412 /modules/markup/markdown/renderconfig_test.go
parent2d2cf589f72241c0ae3c8c05f899950eebb286a6 (diff)
downloadgitea-93df41f506fb0c3ca897def5d62abaedc93323d8.tar.gz
gitea-93df41f506fb0c3ca897def5d62abaedc93323d8.zip
Fix slight bug in katex (#21171)
There is a small bug in #20571 whereby `$a a$b b$` will not be correctly detected as a math inline block of `a a$b b`. This PR fixes this. Also reenable test cases as per #21340 Signed-off-by: Andrew Thornton <art27@cantab.net> Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/markup/markdown/renderconfig_test.go')
-rw-r--r--modules/markup/markdown/renderconfig_test.go17
1 files changed, 9 insertions, 8 deletions
diff --git a/modules/markup/markdown/renderconfig_test.go b/modules/markup/markdown/renderconfig_test.go
index 1027035cda..672edbf46d 100644
--- a/modules/markup/markdown/renderconfig_test.go
+++ b/modules/markup/markdown/renderconfig_test.go
@@ -5,6 +5,7 @@
package markdown
import (
+ "strings"
"testing"
"gopkg.in/yaml.v3"
@@ -81,9 +82,9 @@ func TestRenderConfig_UnmarshalYAML(t *testing.T) {
TOC: true,
Lang: "testlang",
}, `
- include_toc: true
- lang: testlang
-`,
+ include_toc: true
+ lang: testlang
+ `,
},
{
"complexlang", &RenderConfig{
@@ -91,9 +92,9 @@ func TestRenderConfig_UnmarshalYAML(t *testing.T) {
Icon: "table",
Lang: "testlang",
}, `
- gitea:
- lang: testlang
-`,
+ gitea:
+ lang: testlang
+ `,
},
{
"complexlang2", &RenderConfig{
@@ -140,8 +141,8 @@ func TestRenderConfig_UnmarshalYAML(t *testing.T) {
Icon: "table",
Lang: "",
}
- if err := yaml.Unmarshal([]byte(tt.args), got); err != nil {
- t.Errorf("RenderConfig.UnmarshalYAML() error = %v", err)
+ if err := yaml.Unmarshal([]byte(strings.ReplaceAll(tt.args, "\t", " ")), got); err != nil {
+ t.Errorf("RenderConfig.UnmarshalYAML() error = %v\n%q", err, tt.args)
return
}