diff options
author | Giteabot <teabot@gitea.io> | 2024-05-04 12:04:05 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-05-04 12:04:05 +0800 |
commit | 471b411873fd14f2fb161322022863680e294d75 (patch) | |
tree | 355c44aa75f02d25f628d61eb761b3cac1f28c8f /modules/markup/html_codepreview.go | |
parent | a82e6301f77d3dce95e7945a05429e3d594bd246 (diff) | |
download | gitea-471b411873fd14f2fb161322022863680e294d75.tar.gz gitea-471b411873fd14f2fb161322022863680e294d75.zip |
Fix markdown URL parsing for commit ID (#30812) (#30855)
Backport #30812 by wxiaoguang
Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
Diffstat (limited to 'modules/markup/html_codepreview.go')
-rw-r--r-- | modules/markup/html_codepreview.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/modules/markup/html_codepreview.go b/modules/markup/html_codepreview.go index d9da24ea34..5ef2217e3d 100644 --- a/modules/markup/html_codepreview.go +++ b/modules/markup/html_codepreview.go @@ -60,7 +60,8 @@ func renderCodeBlock(ctx *RenderContext, node *html.Node) (urlPosStart, urlPosSt } func codePreviewPatternProcessor(ctx *RenderContext, node *html.Node) { - for node != nil { + nodeStop := node.NextSibling + for node != nodeStop { if node.Type != html.TextNode { node = node.NextSibling continue |