code.gitea.io/gitea@v1.19.3/modules/markup/common/html.go (about)

     1  // Copyright 2019 The Gitea Authors. All rights reserved.
     2  // SPDX-License-Identifier: MIT
     3  
     4  package common
     5  
     6  import (
     7  	"mvdan.cc/xurls/v2"
     8  )
     9  
    10  // NOTE: All below regex matching do not perform any extra validation.
    11  // Thus a link is produced even if the linked entity does not exist.
    12  // While fast, this is also incorrect and lead to false positives.
    13  // TODO: fix invalid linking issue
    14  
    15  // LinkRegex is a regexp matching a valid link
    16  var LinkRegex, _ = xurls.StrictMatchingScheme("https?://")