seancribbs / codehighlighter-languages

Extra or modified languages for Dan Webb's CodeHighlighter.js

This URL has Read+Write access

johnmuhl (author)
Tue Oct 21 10:12:14 -0700 2008
seancribbs (committer)
Tue Oct 21 10:12:14 -0700 2008
codehighlighter-languages / haml.js
100644 33 lines (33 sloc) 0.521 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
CodeHighlighter.addStyle('haml', {
  preserve: {
    exp: /\B~(?=[\s\w])\B/
  },
  comment: {
    exp: /\B\/[^\n]*/
  },
  classDiv: {
    exp: /\.\w+\b/
  },
  idDiv: {
    exp: /\#\w+\b/
  },
  doctype: {
    exp: /^!!![^\n]*/
  },
  tag: {
    exp: /\%\w+\b/
  },
  emit: {
    exp: /\B=(?=[\s\w])/
  },
  interpolate: {
    exp: /\B(==)\B([^\n]*)/,
    replacement: "<span class='interpolate'>$1</span><span class='string'>$2</span>"
  },
  symbol: {
    exp: /:\w+/
  },
  string: {
    exp: /"[^"]*"|'[^']*'/
  }
})