diff options
author | Giteabot <teabot@gitea.io> | 2024-04-03 02:20:16 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 02:20:16 +0800 |
commit | 6bf6fa8de0b4a0467aee9415ede4bb4756d424ec (patch) | |
tree | ca74aa21ab836328591843bbb0434d431a94e992 /routers | |
parent | deaabf66d91b4d6465ee29432bee5e1e304c9e11 (diff) | |
download | gitea-6bf6fa8de0b4a0467aee9415ede4bb4756d424ec.tar.gz gitea-6bf6fa8de0b4a0467aee9415ede4bb4756d424ec.zip |
Render embedded code preview by permlink in markdown (#30234) (#30249)
Backport #30234 by wxiaoguang
The permlink in markdown will be rendered as a code preview block, like GitHub
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Co-authored-by: silverwind <me@silverwind.io>
Diffstat (limited to 'routers')
-rw-r--r-- | routers/web/repo/search.go | 2 | ||||
-rw-r--r-- | routers/web/repo/wiki_test.go | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/routers/web/repo/search.go b/routers/web/repo/search.go index 9d65427b8f..46f0208453 100644 --- a/routers/web/repo/search.go +++ b/routers/web/repo/search.go @@ -81,7 +81,7 @@ func Search(ctx *context.Context) { // UpdatedUnix: not supported yet // Language: not supported yet // Color: not supported yet - Lines: code_indexer.HighlightSearchResultCode(r.Filename, r.LineNumbers, strings.Join(r.LineCodes, "\n")), + Lines: code_indexer.HighlightSearchResultCode(r.Filename, "", r.LineNumbers, strings.Join(r.LineCodes, "\n")), }) } } diff --git a/routers/web/repo/wiki_test.go b/routers/web/repo/wiki_test.go index 52e216e6a0..8b5207f9d9 100644 --- a/routers/web/repo/wiki_test.go +++ b/routers/web/repo/wiki_test.go @@ -145,7 +145,7 @@ func TestNewWikiPost_ReservedName(t *testing.T) { }) NewWikiPost(ctx) assert.EqualValues(t, http.StatusOK, ctx.Resp.Status()) - assert.EqualValues(t, ctx.Tr("repo.wiki.reserved_page"), ctx.Flash.ErrorMsg) + assert.EqualValues(t, ctx.Tr("repo.wiki.reserved_page", "_edit"), ctx.Flash.ErrorMsg) assertWikiNotExists(t, ctx.Repo.Repository, "_edit") } |