function lynxFormatting(split) { split = split.replace(/^>[^\&].*/g, greenTextFunction) split = split.replace(/\=\=.+?\=\=/g, redTextFunction) split = split.replace(/\'\'\'.+?\'\'\'/g, boldFunction) split = split.replace(/\'\'.+?\'\'/g, italicFunction) split = split.replace(/\_\_.+?\_\_/g, underlineFunction) split = split.replace(/\~\~.+?\~\~/g, strikeFunction) split = split.replace(/\[spoiler\].+?\[\/spoiler\]/g, spoilerFunction) split = split.replace(/\*\*.+?\*\*/g, altSpoilerFunction) split = split.replace(/\[aa\]/g, '') split = split.replace(/\[\/aa\]/g, '') // FIXME: how do we get this board setting? //if (replaceCode) { // was a code tag but a code tag doesn't preserve spaces in html split = split.replace(/\[code\]/g, '
') split = split.replace(/\[\/code\]/g, '') //} //start youtube addon split = split.replace(/\[youtube\](.*)\[\/youtube\]/gi, YoutubeEmbedFunction) split = split.replace(/\[niconico\](.*)\[\/niconico\]/gi, NicoNicoEmbedFunction) return split } var greenTextFunction = function(match) { return '' + match + '' } var redTextFunction = function(match) { var content = match.substring(2, match.length - 2) return '' + content + '' } var italicFunction = function(match) { return '' + match.substring(2, match.length - 2) + '' } var boldFunction = function(match) { return '' + match.substring(3, match.length - 3) + '' } var underlineFunction = function(match) { return '' + match.substring(2, match.length - 2) + '' } var strikeFunction = function(match) { return '