mirror of
https://codeberg.org/forgejo/forgejo
synced 2024-11-26 03:36:10 +01:00
Refactor some Str2html code (followup)
* [BUG] Restrict when to make link absolute in markdown
This commit is contained in:
parent
68099f2f00
commit
58bc3af08d
|
@ -742,7 +742,7 @@ Citation needed[^0].`,
|
||||||
for _, test := range testcases {
|
for _, test := range testcases {
|
||||||
res, err := markdown.RenderString(&markup.RenderContext{Ctx: git.DefaultContext}, test.testcase)
|
res, err := markdown.RenderString(&markup.RenderContext{Ctx: git.DefaultContext}, test.testcase)
|
||||||
assert.NoError(t, err, "Unexpected error in testcase: %q", test.testcase)
|
assert.NoError(t, err, "Unexpected error in testcase: %q", test.testcase)
|
||||||
assert.Equal(t, test.expected, res, "Unexpected result in testcase %q", test.testcase)
|
assert.Equal(t, test.expected, string(res), "Unexpected result in testcase %q", test.testcase)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1189,7 +1189,7 @@ func TestCustomMarkdownURL(t *testing.T) {
|
||||||
},
|
},
|
||||||
}, input)
|
}, input)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(buffer))
|
assert.Equal(t, strings.TrimSpace(expected), strings.TrimSpace(string(buffer)))
|
||||||
}
|
}
|
||||||
|
|
||||||
test("[test](abp:subscribe?location=https://codeberg.org/filters.txt&title=joy)",
|
test("[test](abp:subscribe?location=https://codeberg.org/filters.txt&title=joy)",
|
||||||
|
|
Loading…
Reference in a new issue