link abbreviation syntax

This file is copyright © 2004,2005,2006,2011 by Panu Kalliokoski and released under the stx2any license.

This file has definitions for link abbreviations. This is the third phase of processing link abbreviations: the link data has already been gathered by gather data for linking constructs and the link blocks have been deleted by removing link data blocks.

Labels.

s#\[+\([^][]*\)+\]#`'w_autolabel(`\1')#g

Rest of generic link syntaces. Some generic links (namely, those of the third type, in line-initial position) have already been converted by removing link data blocks to protect its own logic.

s#\[\([^][]*\)\]\[\([^][]*[^][`]\)\]#`'w_generic_link(`\2', `\1')#g
s#\([^ \n,.;:!?"'-]*[^[ \n,.;:!?"'-]\)\[\([^][]*[^][`]\)\]#`'w_generic_link(`\2', `\1')#g
s#\([ \n({<"'.:-]\)\[\([^][]*[^][`]\)\]#\1w_generic_link(`\2')#g
s#^\[\([^][]*[^][`]\)\]#w_generic_link(`\1')#g

URLs.

s#^# #
s#\([ \n([{<"'-]\)\(https*://[^ \n]*[A-Za-z0-9_/]\)#\1w_url(`\2')#g
s#\([ \n([{<"'-]\)\(ftps*://[^ \n]*[A-Za-z0-9_/]\)#\1w_url(`\2')#g
s#\([ \n([{<"'-]\)\(gopher://[^ \n]*[A-Za-z0-9_/]\)#\1w_url(`\2')#g
s#\([ \n([{<"'-]\)\(nntp://[^ \n]*[A-Za-z0-9_/]\)#\1w_url(`\2')#g
s#\([ \n([{<"'-]\)\(file:/[^ \n]*[A-Za-z0-9_]\)#\1w_url(`\2')#g
s#\([ \n([{<"'-]\)\(mailto:[^ \n]*[A-Za-z0-9_]\)#\1w_url(`\2')#g
s#\([ \n([{<"'-]\)\(news:[^ \n]*[A-Za-z0-9_]\)#\1w_url(`\2')#g
s#^ ##