// create toggle for wiki feature // document.writeln('
$1'); // paragraph //****** reinclude protected areas text = include_all(text); //*** insert info as html comment (version and so on) text = info.inject(text); textarea.value=text; } // return false; } /* replace words surrounded by wikitags with pm markup eg " *words* " -> " words " */ function around_words ( doc, monk_tag, wiki_tag, inner_re) { var empty = '(^|\\s|$)'; var marker = '(\\' + wiki_tag + ')'; var inner_grp = '(' + inner_re + ')'; var regex = new RegExp( empty + marker + inner_grp + marker + empty, 'g'); var pre_tag = '<' + monk_tag + '>'; var post_tag = '' + monk_tag + '>'; var substitute = '$1' + pre_tag + '$3' + post_tag + '$5'; // console.log(doc,regex,substitute); text=text.replace( regex, substitute); } function around_paragraph ( doc, monk_tag, wiki_tag, inner_re) { //stub } /* transform headlines (both ways) eg "^=== text" <->
text=text.replace(/
/g,'');
// no quote
text=text.replace(/(^|\n\n)(> )([^]*?)<\/I>(?=\n\n|$)/g,'$1> $3');
// revert around word markup
text=text.replace(/<\/?I>/g,'/');
text=text.replace(/<\/?B>/g,'*');
text=text.replace(/<\/?U>/g,'_');
// revert listitems
text=text.replace(/..
text = heading(text,1);
// reinclude protected areas
text = include_all(text);
// revert ' (was protected)
text=text.replace(/<\/?C>/g,"'");
textarea.value=text;
}
}
function link_module(match, pre, name, post, offset, string) {
var core_modules = {
'B::Deparse' : 1,
};
var protokoll= core_modules[name] ? 'doc' : 'metamod';
return pre+'['+protokoll.toUpperCase()+'://'+name+']'+post;
}
(function (){
var DBG=false;
var counter=0;
// var matches = [];
var exclusions = [];
var delim="\0";
var delim0=delim+"<<";
var delim1=">>"+delim;
init_exclusions =function (text) {
exclusions = [];
counter=0;
text = exclude(text,new RegExp(delim+"+","g"),"delim");
return text;
}
exclude_all = function (text){
text = exclude(text,/<(c|code)>[^]*?<\/\1>/gi, "code" );
text = exclude(text,/<(blockquote)>[^]*?<\/\1>/gi, "blockquote" );
text = exclude(text,/<(pre)>[^]*?<\/\1>/gi, "pre" );
text = exclude(text,/\[(\w+):\/\/.*?\]/g, "link" );
// hide