summaryrefslogtreecommitdiff
path: root/src/scanners.re
diff options
context:
space:
mode:
authorJohn MacFarlane <jgm@berkeley.edu>2015-03-29 22:13:24 -0700
committerJohn MacFarlane <jgm@berkeley.edu>2015-03-29 22:13:55 -0700
commitf99a680b089eee01797e085a6d9f5c5398907a57 (patch)
tree741f80660b6c11946d7abab5541f8e453d2f6406 /src/scanners.re
parent7fdb93306d64607d40953bbbd53d961944819c73 (diff)
Scanners: added _scan_scheme, scan_scheme.
This is used in the commonmark renderer.
Diffstat (limited to 'src/scanners.re')
-rw-r--r--src/scanners.re11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/scanners.re b/src/scanners.re
index c6ebae3..31cdb4f 100644
--- a/src/scanners.re
+++ b/src/scanners.re
@@ -69,6 +69,17 @@ int _scan_at(int (*scanner)(const unsigned char *), cmark_chunk *c, int offset)
scheme = 'coap'|'doi'|'javascript'|'aaa'|'aaas'|'about'|'acap'|'cap'|'cid'|'crid'|'data'|'dav'|'dict'|'dns'|'file'|'ftp'|'geo'|'go'|'gopher'|'h323'|'http'|'https'|'iax'|'icap'|'im'|'imap'|'info'|'ipp'|'iris'|'iris.beep'|'iris.xpc'|'iris.xpcs'|'iris.lwz'|'ldap'|'mailto'|'mid'|'msrp'|'msrps'|'mtqp'|'mupdate'|'news'|'nfs'|'ni'|'nih'|'nntp'|'opaquelocktoken'|'pop'|'pres'|'rtsp'|'service'|'session'|'shttp'|'sieve'|'sip'|'sips'|'sms'|'snmp'|'soap.beep'|'soap.beeps'|'tag'|'tel'|'telnet'|'tftp'|'thismessage'|'tn3270'|'tip'|'tv'|'urn'|'vemmi'|'ws'|'wss'|'xcon'|'xcon-userid'|'xmlrpc.beep'|'xmlrpc.beeps'|'xmpp'|'z39.50r'|'z39.50s'|'adiumxtra'|'afp'|'afs'|'aim'|'apt'|'attachment'|'aw'|'beshare'|'bitcoin'|'bolo'|'callto'|'chrome'|'chrome-extension'|'com-eventbrite-attendee'|'content'|'cvs'|'dlna-playsingle'|'dlna-playcontainer'|'dtn'|'dvb'|'ed2k'|'facetime'|'feed'|'finger'|'fish'|'gg'|'git'|'gizmoproject'|'gtalk'|'hcp'|'icon'|'ipn'|'irc'|'irc6'|'ircs'|'itms'|'jar'|'jms'|'keyparc'|'lastfm'|'ldaps'|'magnet'|'maps'|'market'|'message'|'mms'|'ms-help'|'msnim'|'mumble'|'mvn'|'notes'|'oid'|'palm'|'paparazzi'|'platform'|'proxy'|'psyc'|'query'|'res'|'resource'|'rmi'|'rsync'|'rtmp'|'secondlife'|'sftp'|'sgn'|'skype'|'smb'|'soldat'|'spotify'|'ssh'|'steam'|'svn'|'teamspeak'|'things'|'udp'|'unreal'|'ut2004'|'ventrilo'|'view-source'|'webcal'|'wtai'|'wyciwyg'|'xfire'|'xri'|'ymsgr';
*/
+// Try to match a scheme including colon.
+int _scan_scheme(const unsigned char *p)
+{
+ const unsigned char *marker = NULL;
+ const unsigned char *start = p;
+/*!re2c
+ scheme [:] { return (p - start); }
+ .? { return 0; }
+*/
+}
+
// Try to match URI autolink after first <, returning number of chars matched.
int _scan_autolink_uri(const unsigned char *p)
{