source: OpenRLabs-Git/deploy/rlabs-docker/web2py-rlabs/applications/admin/static/codemirror/mode/xml/test.js

main
Last change on this file was 42bd667, checked in by David Fuertes <dfuertes@…>, 4 years ago

Historial Limpio

  • Property mode set to 100755
File size: 1.7 KB
Line 
1// CodeMirror, copyright (c) by Marijn Haverbeke and others
2// Distributed under an MIT license: http://codemirror.net/LICENSE
3
4(function() {
5  var mode = CodeMirror.getMode({indentUnit: 2}, "xml"), mname = "xml";
6  function MT(name) { test.mode(name, mode, Array.prototype.slice.call(arguments, 1), mname); }
7
8  MT("matching",
9     "[tag&bracket <][tag top][tag&bracket >]",
10     "  text",
11     "  [tag&bracket <][tag inner][tag&bracket />]",
12     "[tag&bracket </][tag top][tag&bracket >]");
13
14  MT("nonmatching",
15     "[tag&bracket <][tag top][tag&bracket >]",
16     "  [tag&bracket <][tag inner][tag&bracket />]",
17     "  [tag&bracket </][tag&error tip][tag&bracket&error >]");
18
19  MT("doctype",
20     "[meta <!doctype foobar>]",
21     "[tag&bracket <][tag top][tag&bracket />]");
22
23  MT("cdata",
24     "[tag&bracket <][tag top][tag&bracket >]",
25     "  [atom <![CDATA[foo]",
26     "[atom barbazguh]]]]>]",
27     "[tag&bracket </][tag top][tag&bracket >]");
28
29  // HTML tests
30  mode = CodeMirror.getMode({indentUnit: 2}, "text/html");
31
32  MT("selfclose",
33     "[tag&bracket <][tag html][tag&bracket >]",
34     "  [tag&bracket <][tag link] [attribute rel]=[string stylesheet] [attribute href]=[string \"/foobar\"][tag&bracket >]",
35     "[tag&bracket </][tag html][tag&bracket >]");
36
37  MT("list",
38     "[tag&bracket <][tag ol][tag&bracket >]",
39     "  [tag&bracket <][tag li][tag&bracket >]one",
40     "  [tag&bracket <][tag li][tag&bracket >]two",
41     "[tag&bracket </][tag ol][tag&bracket >]");
42
43  MT("valueless",
44     "[tag&bracket <][tag input] [attribute type]=[string checkbox] [attribute checked][tag&bracket />]");
45
46  MT("pThenArticle",
47     "[tag&bracket <][tag p][tag&bracket >]",
48     "  foo",
49     "[tag&bracket <][tag article][tag&bracket >]bar");
50
51})();
Note: See TracBrowser for help on using the repository browser.