alexgorbatchev/SyntaxHighlighter — Issue #69: my brush for smarty
Author: gtraxx
Created: 2011-12-16 15:40:56+00:00
State: open

Hello, I wrote a brush for the color code Smarty3, but I encountered some problems.
He ignores my variable "plugins" and do not colorize them.
And I also have a problem with a regex for the color of all that is between #mytest#.
```javascript
;(function()
{
// CommonJS
typeof(require) != 'undefined' ? SyntaxHighlighter = require('shCore').SyntaxHighlighter : null;

function Brush(){
var plugins	= 'capitalize cat count_characters count_paragraphs count_sentences count_words'+
'date_format default escape from_charset indent lower nl2br regex_replace replace'+
'spacify string_format strip strip_tags to_charset truncate unescape upper wordwrap';

var keywords = 'if else elseif foreach';

this.regexList = [
{ regex: SyntaxHighlighter.regexLib.singleLineCComments,	css: 'comments' },	// one line comments
{ regex: SyntaxHighlighter.regexLib.multiLineCComments,	css: 'comments' },	// multiline comments
{ regex: SyntaxHighlighter.regexLib.doubleQuotedString,	css: 'string' },	// double quoted strings
{ regex: SyntaxHighlighter.regexLib.singleQuotedString,	css: 'string' },	// single quoted strings
{ regex: new RegExp('(\\$)\\w+', 'g'),	css: 'variable' }, // variables
{ regex: /\s*#.*/gm,	css: 'variable' },
{ regex: new RegExp(this.getKeywords(plugins), 'gmi'),	css: 'functions' },	// common functions
{ regex: new RegExp(this.getKeywords(keywords), 'gmi'),	css: 'keyword' }	// keyword
];
this.forHtmlScript(SyntaxHighlighter.regexLib.scriptScriptTags);
};

Brush.prototype	= new SyntaxHighlighter.Highlighter();
Brush.aliases	= ['smarty','smarty3'];

SyntaxHighlighter.brushes.Smarty3 = Brush;

// CommonJS
typeof(exports) != 'undefined' ? exports.Brush = Brush : null;
})();
```
Best regards