/*
* Javascript BBCode Parser Config Options
* @author Philip Nicolcev
* @license MIT License
*/
var parserColors = [ 'gray', 'silver', 'white', 'yellow', 'orange', 'red', 'fuchsia', 'blue', 'green', 'black', '#cd38d9' ];
var parserTags = {
'b': {
openTag: function(params,content) {
return '';
},
closeTag: function(params,content) {
return '';
}
},
'code': {
openTag: function(params,content) {
return '';
},
closeTag: function(params,content) {
return '
';
},
noParse: true
},
'color': {
openTag: function(params,content) {
var colorCode = params.substr(1) || "inherit";
BBCodeParser.regExpAllowedColors.lastIndex = 0;
BBCodeParser.regExpValidHexColors.lastIndex = 0;
if ( !BBCodeParser.regExpAllowedColors.test( colorCode ) ) {
if ( !BBCodeParser.regExpValidHexColors.test( colorCode ) ) {
colorCode = "inherit";
} else {
if (colorCode.substr(0,1) !== "#") {
colorCode = "#" + colorCode;
}
}
}
return '';
},
closeTag: function(params,content) {
return '';
}
},
'i': {
openTag: function(params,content) {
return '';
},
closeTag: function(params,content) {
return '';
}
},
'img': {
openTag: function(params,content) {
var myUrl = content;
BBCodeParser.urlPattern.lastIndex = 0;
if ( !BBCodeParser.urlPattern.test( myUrl ) ) {
myUrl = "";
}
return '';
},
closeTag: function(params,content) {
return '';
},
content: function(params,content) {
return '';
}
},
'list': {
openTag: function(params,content) {
return '
'; }, closeTag: function(params,content) { return ''; } }, 's': { openTag: function(params,content) { return '
'; }, closeTag: function(params,content) { return '
'; } }, 'center': { openTag: function(params,content) { return ''; }, closeTag: function(params,content) { return '
'; } }, 'right': { openTag: function(params,content) { return ''; }, closeTag: function(params,content) { return '
'; } }, 'justify': { openTag: function(params,content) { return ''; }, closeTag: function(params,content) { return '
'; } }, 'ul': { openTag: function(params,content) { return '