Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
malwaredllc
GitHub Repository: malwaredllc/byob
Path: blob/master/web-gui/buildyourownbotnet/assets/js/codemirror/mode/haml/test.js
1293 views
1
(function() {
2
var mode = CodeMirror.getMode({tabSize: 4, indentUnit: 2}, "haml");
3
function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1)); }
4
5
// Requires at least one media query
6
MT("elementName",
7
"[tag %h1] Hey There");
8
9
MT("oneElementPerLine",
10
"[tag %h1] Hey There %h2");
11
12
MT("idSelector",
13
"[tag %h1][attribute #test] Hey There");
14
15
MT("classSelector",
16
"[tag %h1][attribute .hello] Hey There");
17
18
MT("docType",
19
"[tag !!! XML]");
20
21
MT("comment",
22
"[comment / Hello WORLD]");
23
24
MT("notComment",
25
"[tag %h1] This is not a / comment ");
26
27
MT("attributes",
28
"[tag %a]([variable title][operator =][string \"test\"]){[atom :title] [operator =>] [string \"test\"]}");
29
30
MT("htmlCode",
31
"[tag <h1>]Title[tag </h1>]");
32
33
MT("rubyBlock",
34
"[operator =][variable-2 @item]");
35
36
MT("selectorRubyBlock",
37
"[tag %a.selector=] [variable-2 @item]");
38
39
MT("nestedRubyBlock",
40
"[tag %a]",
41
" [operator =][variable puts] [string \"test\"]");
42
43
MT("multilinePlaintext",
44
"[tag %p]",
45
" Hello,",
46
" World");
47
48
MT("multilineRuby",
49
"[tag %p]",
50
" [comment -# this is a comment]",
51
" [comment and this is a comment too]",
52
" Date/Time",
53
" [operator -] [variable now] [operator =] [tag DateTime][operator .][variable now]",
54
" [tag %strong=] [variable now]",
55
" [operator -] [keyword if] [variable now] [operator >] [tag DateTime][operator .][variable parse]([string \"December 31, 2006\"])",
56
" [operator =][string \"Happy\"]",
57
" [operator =][string \"Belated\"]",
58
" [operator =][string \"Birthday\"]");
59
60
MT("multilineComment",
61
"[comment /]",
62
" [comment Multiline]",
63
" [comment Comment]");
64
65
MT("hamlComment",
66
"[comment -# this is a comment]");
67
68
MT("multilineHamlComment",
69
"[comment -# this is a comment]",
70
" [comment and this is a comment too]");
71
72
MT("multilineHTMLComment",
73
"[comment <!--]",
74
" [comment what a comment]",
75
" [comment -->]");
76
77
MT("hamlAfterRubyTag",
78
"[attribute .block]",
79
" [tag %strong=] [variable now]",
80
" [attribute .test]",
81
" [operator =][variable now]",
82
" [attribute .right]");
83
84
MT("stretchedRuby",
85
"[operator =] [variable puts] [string \"Hello\"],",
86
" [string \"World\"]");
87
88
MT("interpolationInHashAttribute",
89
//"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test");
90
"[tag %div]{[atom :id] [operator =>] [string \"#{][variable test][string }_#{][variable ting][string }\"]} test");
91
92
MT("interpolationInHTMLAttribute",
93
"[tag %div]([variable title][operator =][string \"#{][variable test][string }_#{][variable ting]()[string }\"]) Test");
94
})();
95
96