preformatted block and inline element syntax

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

Inline elements may happen anywhere in text. However, they are different from emphasis in that they are not constrained by paragraph boundaries and / or don't require both an opening and closing mark to be present.

Several formatting rules do not apply within a preformatted block. Because of this, we branch past the rest of this stuff and all blocks. Note that because of the special handling of literal blocks, this cannot look right in the formatted document; just look at the source.

/^{{{$/,/^}}}$/ {
s#`#`#g
s#'#'#g
s#^{{{$#w_beg(litblock)#
s#^}}}$#`'w_end(litblock)#
b end
}

Footnotes are transformed directly into the corresponding environment:

s#\[\[$#`'w_beg(footnote)#g
s#^\( *\)\]\]#\1w_end(footnote)`'#g
s#\[\[[- ]#`'w_beg(footnote)`'#g
s#[- ]\]\]#`'w_end(footnote)`'#g

Special characters.

s#^\( *\)-- #\1w_emdash`'w_emdash_separate`'#
s# -- #`'w_emdash_separate`'w_emdash`'w_emdash_separate`'#g
s# --$#`'w_emdash_separate`'w_emdash#
s#\([A-Za-z0-9])*\)--\((*[A-Za-z0-9]\)#\1`'w_endash`'\2#g
s#\.\.\.\([] ,.;:?!)}>"-]\)#`'w_ellipsis\1#g
s#\.\.\.$#`'w_ellipsis#
s#\([ ([{<"-]\)([cC])\([ :1-9]\)#\1w_copyrightsign\2#g
s#^([cC])\([ :1-9]\)#w_copyrightsign\1#g
s#\([ ([{<"-]\)([cC])$#\1w_copyrightsign#
s#([tT][mM])#`'w_trademarksign`'#g
s# -> # w_rarrow #g
s#^-> #w_rarrow #
s# ->$# w_rarrow#
s# <- # w_larrow #g
s#^<- #w_larrow #
s# <-$# w_larrow#

Some constructs that may occur most anywhere:

s#||#`'w_horizbr`'#g
s#//$#`'w_linebr#