Fix markdown URL parsing for commit ID (#30812) (#30855)

Backport #30812 by wxiaoguang

Co-authored-by: wxiaoguang <wxiaoguang@gmail.com>
This commit is contained in:
Giteabot 2024-05-04 12:04:05 +08:00 committed by GitHub
parent a82e6301f7
commit 471b411873
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
4 changed files with 116 additions and 75 deletions

View file

@ -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