premier commit
[bazdig.git] / bazdig / codepress / languages / html.js
blob94469b448a0bd46cde8ce8508ca3a266300a6c44
1 /*\r
2  * CodePress regular expressions for HTML syntax highlighting\r
3  */\r
4 \r
5 // HTML\r
6 Language.syntax = [\r
7         { input : /(&lt;[^!]*?&gt;)/g, output : '<b>$1</b>'     }, // all tags\r
8         { input : /(&lt;a .*?&gt;|&lt;\/a&gt;)/g, output : '<a>$1</a>' }, // links\r
9         { input : /(&lt;img .*?&gt;)/g, output : '<big>$1</big>' }, // images\r
10         { input : /(&lt;\/?(button|textarea|form|input|select|option|label).*?&gt;)/g, output : '<u>$1</u>' }, // forms\r
11         { input : /(&lt;style.*?&gt;)(.*?)(&lt;\/style&gt;)/g, output : '<em>$1</em><em>$2</em><em>$3</em>' }, // style tags\r
12         { input : /(&lt;script.*?&gt;)(.*?)(&lt;\/script&gt;)/g, output : '<strong>$1</strong><tt>$2</tt><strong>$3</strong>' }, // script tags\r
13         { input : /=(".*?")/g, output : '=<s>$1</s>' }, // atributes double quote\r
14         { input : /=('.*?')/g, output : '=<s>$1</s>' }, // atributes single quote\r
15         { input : /(&lt;!--.*?--&gt.)/g, output : '<ins>$1</ins>' }, // comments \r
16         { 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 : '<i>$1</i>' } // script reserved words \r
17 ]\r
19 Language.snippets = [\r
20         { input : 'aref', output : '<a href="$0"></a>' },\r
21         { input : 'h1', output : '<h1>$0</h1>' },\r
22         { input : 'h2', output : '<h2>$0</h2>' },\r
23         { input : 'h3', output : '<h3>$0</h3>' },\r
24         { input : 'h4', output : '<h4>$0</h4>' },\r
25         { input : 'h5', output : '<h5>$0</h5>' },\r
26         { input : 'h6', output : '<h6>$0</h6>' },\r
27         { input : 'html', output : '<html>\n\t$0\n</html>' },\r
28         { input : 'head', output : '<head>\n\t<meta http-equiv="content-type" content="text/html; charset=utf-8" />\n\t<title>$0</title>\n\t\n</head>' },\r
29         { input : 'img', output : '<img src="$0" alt="" />' },\r
30         { input : 'input', output : '<input name="$0" id="" type="" value="" />' },\r
31         { input : 'label', output : '<label for="$0"></label>' },\r
32         { input : 'legend', output : '<legend>\n\t$0\n</legend>' },\r
33         { input : 'link', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },              \r
34         { input : 'base', output : '<base href="$0" />' }, \r
35         { input : 'body', output : '<body>\n\t$0\n</body>' }, \r
36         { input : 'css', output : '<link rel="stylesheet" href="$0" type="text/css" media="screen" charset="utf-8" />' },\r
37         { input : 'div', output : '<div>\n\t$0\n</div>' },\r
38         { input : 'divid', output : '<div id="$0">\n\t\n</div>' },\r
39         { input : 'dl', output : '<dl>\n\t<dt>\n\t\t$0\n\t</dt>\n\t<dd></dd>\n</dl>' },\r
40         { input : 'fieldset', output : '<fieldset>\n\t$0\n</fieldset>' },\r
41         { input : 'form', output : '<form action="$0" method="" name="">\n\t\n</form>' },\r
42         { input : 'meta', output : '<meta name="$0" content="" />' },\r
43         { input : 'p', output : '<p>$0</p>' },\r
44         { input : 'script', output : '<script type="text/javascript" language="javascript" charset="utf-8">\n\t$0\t\n</script>' },\r
45         { input : 'scriptsrc', output : '<script src="$0" type="text/javascript" language="javascript" charset="utf-8"></script>' },\r
46         { input : 'span', output : '<span>$0</span>' },\r
47         { input : 'table', output : '<table border="$0" cellspacing="" cellpadding="">\n\t<tr><th></th></tr>\n\t<tr><td></td></tr>\n</table>' },\r
48         { input : 'style', output : '<style type="text/css" media="screen">\n\t$0\n</style>' }\r
49 ]\r
50         \r
51 Language.complete = [\r
52         { input : '\'',output : '\'$0\'' },\r
53         { input : '"', output : '"$0"' },\r
54         { input : '(', output : '\($0\)' },\r
55         { input : '[', output : '\[$0\]' },\r
56         { input : '{', output : '{\n\t$0\n}' }          \r
57 ]\r
59 Language.shortcuts = []\r