github.com/gitbundle/modules@v0.0.0-20231025071548-85b91c5c3b01/markup/common/html.go (about)

     1  // Copyright 2023 The GitBundle Inc. All rights reserved.
     2  // Copyright 2017 The Gitea Authors. All rights reserved.
     3  // Use of this source code is governed by a MIT-style
     4  // license that can be found in the LICENSE file.
     5  
     6  package common
     7  
     8  import (
     9  	"mvdan.cc/xurls/v2"
    10  )
    11  
    12  // NOTE: All below regex matching do not perform any extra validation.
    13  // Thus a link is produced even if the linked entity does not exist.
    14  // While fast, this is also incorrect and lead to false positives.
    15  // TODO: fix invalid linking issue
    16  
    17  // LinkRegex is a regexp matching a valid link
    18  var LinkRegex, _ = xurls.StrictMatchingScheme("https?://")