# Wiki style links
} else if ( match( line, /^\[\[([^]|]+)(\|[^]]+)?\]\]/) ) {
len = RLENGTH; href = text = substr(line, 1, len);
- sub(/^\[\[([^]|]+)(\|([^]]+))?\]\]/, "\\1", href );
- sub(/^\[\[([^]|]+)(\|([^]]+))?\]\]/, "\\3", text );
+ sub(/^\[\[/, "", href); sub(/(\|([^]]+))?\]\].*$/, "", href);
+ sub(/^\[\[([^]|]+)/, "", text); sub(/\]\].*$/, "", text); sub(/^\|/, "", text);
+ # sub(/^\[\[([^]|]+)(\|([^]]+))?\]\]/, "\\1", href );
+ # sub(/^\[\[([^]|]+)(\|([^]]+))?\]\]/, "\\3", text );
if ( ! text ) text = href;
return "<a href=\"" HTML(href) "\">" HTML(text) "</a>" inline( substr( line, len + 1) );
text = substr(text, n + 1); sub(/^[ \t]*/, "", text);
sub(/[ \t]*#*([ \t]*\{([a-zA-Z \t-]*)\})(\n.*)?$/, "", text);
sub(/^(##?#?#?#?#?)[ \t]*(([^ \t\n]+|[ \t]+[^ \t\n#]|[ \t]+#+[ \t]*[^ \t\n#])+)[ \t]*#*[ \t]*\{/, "", attrib);
- sub(/\})(\n.*)?$/, "", attrib);
+ sub(/\}(\n.*)?$/, "", attrib);
gsub(/[^a-zA-Z0-9_-]+/, " ", attrib); gsub(/(^ | $)/, "", attrib);
return headline( n, text, attrib ) _block( substr( block, len + 1) );