summaryrefslogtreecommitdiffstats
path: root/vendor/gitlab.com/golang-commonmark/markdown/urlschema.go
diff options
context:
space:
mode:
authorWim <wim@42.be>2019-01-06 22:25:19 +0100
committerGitHub <noreply@github.com>2019-01-06 22:25:19 +0100
commit04567c765e92ad60c685c1b2fe7e77c46e065645 (patch)
tree34a587a6545c8e71e991e2a1551885faa0075738 /vendor/gitlab.com/golang-commonmark/markdown/urlschema.go
parent048158ad6db08cd714f39467fc0066ce41cfe6c5 (diff)
downloadmatterbridge-msglm-04567c765e92ad60c685c1b2fe7e77c46e065645.tar.gz
matterbridge-msglm-04567c765e92ad60c685c1b2fe7e77c46e065645.tar.bz2
matterbridge-msglm-04567c765e92ad60c685c1b2fe7e77c46e065645.zip
Add support for markdown to HTML conversion (matrix). Closes #663 (#670)
This uses our own gomatrix lib with the SendHTML function which adds HTML to formatted_body in matrix. golang-commonmark is used to convert markdown into valid HTML.
Diffstat (limited to 'vendor/gitlab.com/golang-commonmark/markdown/urlschema.go')
-rw-r--r--vendor/gitlab.com/golang-commonmark/markdown/urlschema.go185
1 files changed, 185 insertions, 0 deletions
diff --git a/vendor/gitlab.com/golang-commonmark/markdown/urlschema.go b/vendor/gitlab.com/golang-commonmark/markdown/urlschema.go
new file mode 100644
index 00000000..06b9e6a1
--- /dev/null
+++ b/vendor/gitlab.com/golang-commonmark/markdown/urlschema.go
@@ -0,0 +1,185 @@
+// Copyright 2015 The Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package markdown
+
+var urlSchemas = []string{
+ "aaa",
+ "aaas",
+ "about",
+ "acap",
+ "adiumxtra",
+ "afp",
+ "afs",
+ "aim",
+ "apt",
+ "attachment",
+ "aw",
+ "beshare",
+ "bitcoin",
+ "bolo",
+ "callto",
+ "cap",
+ "chrome",
+ "chrome-extension",
+ "cid",
+ "coap",
+ "com-eventbrite-attendee",
+ "content",
+ "crid",
+ "cvs",
+ "data",
+ "dav",
+ "dict",
+ "dlna-playcontainer",
+ "dlna-playsingle",
+ "dns",
+ "doi",
+ "dtn",
+ "dvb",
+ "ed2k",
+ "facetime",
+ "feed",
+ "file",
+ "finger",
+ "fish",
+ "ftp",
+ "geo",
+ "gg",
+ "git",
+ "gizmoproject",
+ "go",
+ "gopher",
+ "gtalk",
+ "h323",
+ "hcp",
+ "http",
+ "https",
+ "iax",
+ "icap",
+ "icon",
+ "im",
+ "imap",
+ "info",
+ "ipn",
+ "ipp",
+ "irc",
+ "irc6",
+ "ircs",
+ "iris",
+ "iris.beep",
+ "iris.lwz",
+ "iris.xpc",
+ "iris.xpcs",
+ "itms",
+ "jar",
+ "javascript",
+ "jms",
+ "keyparc",
+ "lastfm",
+ "ldap",
+ "ldaps",
+ "magnet",
+ "mailto",
+ "maps",
+ "market",
+ "message",
+ "mid",
+ "mms",
+ "ms-help",
+ "msnim",
+ "msrp",
+ "msrps",
+ "mtqp",
+ "mumble",
+ "mupdate",
+ "mvn",
+ "news",
+ "nfs",
+ "ni",
+ "nih",
+ "nntp",
+ "notes",
+ "oid",
+ "opaquelocktoken",
+ "palm",
+ "paparazzi",
+ "platform",
+ "pop",
+ "pres",
+ "proxy",
+ "psyc",
+ "query",
+ "res",
+ "resource",
+ "rmi",
+ "rsync",
+ "rtmp",
+ "rtsp",
+ "secondlife",
+ "service",
+ "session",
+ "sftp",
+ "sgn",
+ "shttp",
+ "sieve",
+ "sip",
+ "sips",
+ "skype",
+ "smb",
+ "sms",
+ "snmp",
+ "soap.beep",
+ "soap.beeps",
+ "soldat",
+ "spotify",
+ "ssh",
+ "steam",
+ "svn",
+ "tag",
+ "teamspeak",
+ "tel",
+ "telnet",
+ "tftp",
+ "things",
+ "thismessage",
+ "tip",
+ "tn3270",
+ "tv",
+ "udp",
+ "unreal",
+ "urn",
+ "ut2004",
+ "vemmi",
+ "ventrilo",
+ "view-source",
+ "webcal",
+ "ws",
+ "wss",
+ "wtai",
+ "wyciwyg",
+ "xcon",
+ "xcon-userid",
+ "xfire",
+ "xmlrpc.beep",
+ "xmlrpc.beeps",
+ "xmpp",
+ "xri",
+ "ymsgr",
+ "z39.50r",
+ "z39.50s",
+}
+
+var urlSchemasSet = make(map[string]bool)
+
+func init() {
+ for _, s := range urlSchemas {
+ urlSchemasSet[s] = true
+ }
+}
+
+func matchSchema(s string) bool {
+ _, ok := urlSchemasSet[s]
+ return ok
+}