/* * @author David Callizaya * CodePress regular expressions for HTML syntax highlighting */ // HTML Language.syntax = [ { input : /(<[^!]*?>)/g, output : '$1' }, // all tags /*{ input : /(<a .*?>|<\/a>)/g, output : '$1' }, // links*/ /*{ input : /(<img .*?>)/g, output : '$1' }, // images*/ { input : /<(\/?([a-z_]\w*))/ig, output : '<$1' }, // forms { input : /(<style.*?>)(.*?)(<\/style>)/g, output : '$1$2$3' }, // style tags { input : /(<script.*?>)(.*?)(<\/script>)/g, output : '$1$2$3' }, // script tags { input : /type(\s*)=(\s*)("(?:xmlform|grid|text|currency|percentage|password|textarea|title|subtitle|button|submit|reset|dropdown|yesno|listbox|checkbox|checkgroup|radiogroup|date|hidden|link|file|javascript)")/ig, output : 'type$1=$2$3' }, // atributes double quote { input : /type(\s*)=(\s*)('(?:xmlform|grid|text|currency|percentage|password|textarea|title|subtitle|button|submit|reset|dropdown|yesno|listbox|checkbox|checkgroup|radiogroup|date|hidden|link|file|javascript)')/ig, output : 'type$1=$2$3' }, // atributes single quote { input : /type(\s*)=(\s*)(".*?")/ig, output : 'type$1=$2$3' }, // Invalid type of field in double quote { input : /type(\s*)=(\s*)('.*?')/ig, output : 'type$1=$2$3' }, // Invalid type of field in single quote { input : /=(".*?")/g, output : '=$1' }, // atributes double quote { input : /=('.*?')/g, output : '=$1' }, // atributes single quote { input : /(<!--.*?-->.)/g, output : '$1' }, // comments { input : /(<!\[CDATA\[.*?\]\]>.)/g, output : '$1' }, // comments { input : /\b(alert|window|document|break|continue|do|for|new|this|void|case|default|else|function|return|typeof|while|if|label|switch|var|with|catch|boolean|int|try|false|throws|null|true|goto)\b/g, output : '$1' } // script reserved words ] Language.snippets = [ { input : 'aref', output : '' }, { input : 'h1', output : '

$0

' }, { input : 'h2', output : '

$0

' }, { input : 'h3', output : '

$0

' }, { input : 'h4', output : '

$0

' }, { input : 'h5', output : '
$0
' }, { input : 'h6', output : '
$0
' }, { input : 'html', output : '\n\t$0\n' }, { input : 'head', output : '\n\t\n\t$0\n\t\n' }, { input : 'img', output : '' }, { input : 'input', output : '' }, { input : 'label', output : '' }, { input : 'legend', output : '\n\t$0\n' }, { input : 'link', output : '' }, { input : 'base', output : '' }, { input : 'body', output : '\n\t$0\n' }, { input : 'css', output : '' }, { input : 'div', output : '
\n\t$0\n
' }, { input : 'divid', output : '
\n\t\n
' }, { input : 'dl', output : '
\n\t
\n\t\t$0\n\t
\n\t
\n
' }, { input : 'fieldset', output : '
\n\t$0\n
' }, { input : 'form', output : '
\n\t\n
' }, { input : 'meta', output : '' }, { input : 'p', output : '

$0

' }, { input : 'script', output : '' }, { input : 'scriptsrc', output : '' }, { input : 'span', output : '$0' }, { input : 'table', output : '\n\t\n\t\n
' }, { input : 'style', output : '' } ] Language.complete = [ { input : '\'',output : '\'$0\'' }, { input : '"', output : '"$0"' }, { input : '(', output : '\($0\)' }, { input : '[', output : '\[$0\]' }, { input : '{', output : '{\n\t$0\n}' } ] Language.shortcuts = []