From 3ac1ee16f377d31a0fb80c8dae28b6239ac4229e Mon Sep 17 00:00:00 2001 From: Terin Stock Date: Sun, 9 Mar 2025 17:47:56 +0100 Subject: [chore] remove vendor --- vendor/github.com/k3a/html2text/html2text.go | 333 --------------------------- 1 file changed, 333 deletions(-) delete mode 100644 vendor/github.com/k3a/html2text/html2text.go (limited to 'vendor/github.com/k3a/html2text/html2text.go') diff --git a/vendor/github.com/k3a/html2text/html2text.go b/vendor/github.com/k3a/html2text/html2text.go deleted file mode 100644 index f79fbe395..000000000 --- a/vendor/github.com/k3a/html2text/html2text.go +++ /dev/null @@ -1,333 +0,0 @@ -package html2text - -import ( - "bytes" - "regexp" - "strconv" - "strings" -) - -// Line break constants -// Deprecated: Please use HTML2TextWithOptions(text, WithUnixLineBreak()) -const ( - WIN_LBR = "\r\n" - UNIX_LBR = "\n" -) - -var legacyLBR = WIN_LBR -var badTagnamesRE = regexp.MustCompile(`^(head|script|style|a)($|\s+)`) -var linkTagRE = regexp.MustCompile(`^(?i:a)(?:$|\s).*(?i:href)\s*=\s*('([^']*?)'|"([^"]*?)"|([^\s"'` + "`" + `=<>]+))`) -var badLinkHrefRE = regexp.MustCompile(`javascript:`) -var headersRE = regexp.MustCompile(`^(\/)?h[1-6]`) -var numericEntityRE = regexp.MustCompile(`(?i)^#(x?[a-f0-9]+)$`) - -type options struct { - lbr string - linksInnerText bool - listPrefix string -} - -func newOptions() *options { - // apply defaults - return &options{ - lbr: WIN_LBR, - } -} - -// Option is a functional option -type Option func(*options) - -// WithUnixLineBreaks instructs the converter to use unix line breaks ("\n" instead of "\r\n" default) -func WithUnixLineBreaks() Option { - return func(o *options) { - o.lbr = UNIX_LBR - } -} - -// WithLinksInnerText instructs the converter to retain link tag inner text and append href URLs in angle brackets after the text -// Example: click news -func WithLinksInnerText() Option { - return func(o *options) { - o.linksInnerText = true - } -} - -// WithListSupportPrefix formats