swagr 0.0.7 → 0.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (359) hide show
  1. data/bin/swagr +15 -0
  2. data/examples/examples01/app.rb +6 -2
  3. data/examples/examples01/coffee/data_port.coffee +2 -0
  4. data/examples/examples01/static/css/codemirror.css +1247 -0
  5. data/examples/examples01/static/js/codemirror-compressed-3-0.js +5 -0
  6. data/examples/examples01/static/js/codemirror/keymap/emacs.js +30 -0
  7. data/examples/examples01/static/js/codemirror/keymap/vim.js +2298 -0
  8. data/examples/examples01/static/js/codemirror/lib/codemirror.css +239 -0
  9. data/examples/examples01/static/js/codemirror/lib/codemirror.js +4553 -0
  10. data/examples/examples01/static/js/codemirror/lib/util/closetag.js +85 -0
  11. data/examples/examples01/static/js/codemirror/lib/util/colorize.js +29 -0
  12. data/examples/examples01/static/js/codemirror/lib/util/continuecomment.js +36 -0
  13. data/examples/examples01/static/js/codemirror/lib/util/continuelist.js +28 -0
  14. data/examples/examples01/static/js/codemirror/lib/util/dialog.css +32 -0
  15. data/examples/examples01/static/js/codemirror/lib/util/dialog.js +75 -0
  16. data/examples/examples01/static/js/codemirror/lib/util/foldcode.js +182 -0
  17. data/examples/examples01/static/js/codemirror/lib/util/formatting.js +108 -0
  18. data/examples/examples01/static/js/codemirror/lib/util/javascript-hint.js +137 -0
  19. data/examples/examples01/static/js/codemirror/lib/util/loadmode.js +51 -0
  20. data/examples/examples01/static/js/codemirror/lib/util/match-highlighter.js +46 -0
  21. data/examples/examples01/static/js/codemirror/lib/util/matchbrackets.js +63 -0
  22. data/examples/examples01/static/js/codemirror/lib/util/multiplex.js +95 -0
  23. data/examples/examples01/static/js/codemirror/lib/util/overlay.js +59 -0
  24. data/examples/examples01/static/js/codemirror/lib/util/pig-hint.js +117 -0
  25. data/examples/examples01/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
  26. data/examples/examples01/static/js/codemirror/lib/util/runmode.js +52 -0
  27. data/examples/examples01/static/js/codemirror/lib/util/search.js +119 -0
  28. data/examples/examples01/static/js/codemirror/lib/util/searchcursor.js +119 -0
  29. data/examples/examples01/static/js/codemirror/lib/util/simple-hint.css +16 -0
  30. data/examples/examples01/static/js/codemirror/lib/util/simple-hint.js +102 -0
  31. data/examples/examples01/static/js/codemirror/lib/util/xml-hint.js +131 -0
  32. data/examples/examples01/static/js/codemirror/mode/clike/clike.js +300 -0
  33. data/examples/examples01/static/js/codemirror/mode/clike/index.html +103 -0
  34. data/examples/examples01/static/js/codemirror/mode/clike/scala.html +767 -0
  35. data/examples/examples01/static/js/codemirror/mode/clojure/clojure.js +206 -0
  36. data/examples/examples01/static/js/codemirror/mode/clojure/index.html +67 -0
  37. data/examples/examples01/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
  38. data/examples/examples01/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
  39. data/examples/examples01/static/js/codemirror/mode/coffeescript/index.html +728 -0
  40. data/examples/examples01/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
  41. data/examples/examples01/static/js/codemirror/mode/commonlisp/index.html +165 -0
  42. data/examples/examples01/static/js/codemirror/mode/css/css.js +465 -0
  43. data/examples/examples01/static/js/codemirror/mode/css/index.html +58 -0
  44. data/examples/examples01/static/js/codemirror/mode/css/test.js +501 -0
  45. data/examples/examples01/static/js/codemirror/mode/diff/diff.js +32 -0
  46. data/examples/examples01/static/js/codemirror/mode/diff/index.html +105 -0
  47. data/examples/examples01/static/js/codemirror/mode/ecl/ecl.js +192 -0
  48. data/examples/examples01/static/js/codemirror/mode/ecl/index.html +39 -0
  49. data/examples/examples01/static/js/codemirror/mode/erlang/erlang.js +463 -0
  50. data/examples/examples01/static/js/codemirror/mode/erlang/index.html +64 -0
  51. data/examples/examples01/static/js/codemirror/mode/gfm/gfm.js +94 -0
  52. data/examples/examples01/static/js/codemirror/mode/gfm/index.html +70 -0
  53. data/examples/examples01/static/js/codemirror/mode/gfm/test.js +225 -0
  54. data/examples/examples01/static/js/codemirror/mode/go/go.js +165 -0
  55. data/examples/examples01/static/js/codemirror/mode/go/index.html +74 -0
  56. data/examples/examples01/static/js/codemirror/mode/groovy/groovy.js +210 -0
  57. data/examples/examples01/static/js/codemirror/mode/groovy/index.html +73 -0
  58. data/examples/examples01/static/js/codemirror/mode/haskell/haskell.js +242 -0
  59. data/examples/examples01/static/js/codemirror/mode/haskell/index.html +62 -0
  60. data/examples/examples01/static/js/codemirror/mode/haxe/haxe.js +429 -0
  61. data/examples/examples01/static/js/codemirror/mode/haxe/index.html +90 -0
  62. data/examples/examples01/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  63. data/examples/examples01/static/js/codemirror/mode/htmlembedded/index.html +49 -0
  64. data/examples/examples01/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
  65. data/examples/examples01/static/js/codemirror/mode/htmlmixed/index.html +52 -0
  66. data/examples/examples01/static/js/codemirror/mode/http/http.js +98 -0
  67. data/examples/examples01/static/js/codemirror/mode/http/index.html +32 -0
  68. data/examples/examples01/static/js/codemirror/mode/javascript/index.html +88 -0
  69. data/examples/examples01/static/js/codemirror/mode/javascript/javascript.js +411 -0
  70. data/examples/examples01/static/js/codemirror/mode/javascript/typescript.html +48 -0
  71. data/examples/examples01/static/js/codemirror/mode/jinja2/index.html +38 -0
  72. data/examples/examples01/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
  73. data/examples/examples01/static/js/codemirror/mode/less/index.html +741 -0
  74. data/examples/examples01/static/js/codemirror/mode/less/less.js +266 -0
  75. data/examples/examples01/static/js/codemirror/mode/lua/index.html +74 -0
  76. data/examples/examples01/static/js/codemirror/mode/lua/lua.js +140 -0
  77. data/examples/examples01/static/js/codemirror/mode/markdown/index.html +344 -0
  78. data/examples/examples01/static/js/codemirror/mode/markdown/markdown.js +474 -0
  79. data/examples/examples01/static/js/codemirror/mode/markdown/test.js +1266 -0
  80. data/examples/examples01/static/js/codemirror/mode/mysql/index.html +41 -0
  81. data/examples/examples01/static/js/codemirror/mode/mysql/mysql.js +203 -0
  82. data/examples/examples01/static/js/codemirror/mode/ntriples/index.html +33 -0
  83. data/examples/examples01/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
  84. data/examples/examples01/static/js/codemirror/mode/ocaml/index.html +131 -0
  85. data/examples/examples01/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
  86. data/examples/examples01/static/js/codemirror/mode/pascal/LICENSE +7 -0
  87. data/examples/examples01/static/js/codemirror/mode/pascal/index.html +48 -0
  88. data/examples/examples01/static/js/codemirror/mode/pascal/pascal.js +94 -0
  89. data/examples/examples01/static/js/codemirror/mode/perl/LICENSE +19 -0
  90. data/examples/examples01/static/js/codemirror/mode/perl/index.html +62 -0
  91. data/examples/examples01/static/js/codemirror/mode/perl/perl.js +816 -0
  92. data/examples/examples01/static/js/codemirror/mode/php/index.html +51 -0
  93. data/examples/examples01/static/js/codemirror/mode/php/php.js +129 -0
  94. data/examples/examples01/static/js/codemirror/mode/pig/index.html +42 -0
  95. data/examples/examples01/static/js/codemirror/mode/pig/pig.js +171 -0
  96. data/examples/examples01/static/js/codemirror/mode/plsql/index.html +62 -0
  97. data/examples/examples01/static/js/codemirror/mode/plsql/plsql.js +216 -0
  98. data/examples/examples01/static/js/codemirror/mode/properties/index.html +41 -0
  99. data/examples/examples01/static/js/codemirror/mode/properties/properties.js +63 -0
  100. data/examples/examples01/static/js/codemirror/mode/python/LICENSE.txt +21 -0
  101. data/examples/examples01/static/js/codemirror/mode/python/index.html +124 -0
  102. data/examples/examples01/static/js/codemirror/mode/python/python.js +340 -0
  103. data/examples/examples01/static/js/codemirror/mode/r/LICENSE +24 -0
  104. data/examples/examples01/static/js/codemirror/mode/r/index.html +74 -0
  105. data/examples/examples01/static/js/codemirror/mode/r/r.js +141 -0
  106. data/examples/examples01/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
  107. data/examples/examples01/static/js/codemirror/mode/rpm/changes/index.html +53 -0
  108. data/examples/examples01/static/js/codemirror/mode/rpm/spec/index.html +99 -0
  109. data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
  110. data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
  111. data/examples/examples01/static/js/codemirror/mode/rst/index.html +526 -0
  112. data/examples/examples01/static/js/codemirror/mode/rst/rst.js +314 -0
  113. data/examples/examples01/static/js/codemirror/mode/ruby/LICENSE +24 -0
  114. data/examples/examples01/static/js/codemirror/mode/ruby/index.html +173 -0
  115. data/examples/examples01/static/js/codemirror/mode/ruby/ruby.js +195 -0
  116. data/examples/examples01/static/js/codemirror/mode/rust/index.html +48 -0
  117. data/examples/examples01/static/js/codemirror/mode/rust/rust.js +432 -0
  118. data/examples/examples01/static/js/codemirror/mode/scheme/index.html +65 -0
  119. data/examples/examples01/static/js/codemirror/mode/scheme/scheme.js +230 -0
  120. data/examples/examples01/static/js/codemirror/mode/shell/index.html +51 -0
  121. data/examples/examples01/static/js/codemirror/mode/shell/shell.js +118 -0
  122. data/examples/examples01/static/js/codemirror/mode/sieve/LICENSE +23 -0
  123. data/examples/examples01/static/js/codemirror/mode/sieve/index.html +81 -0
  124. data/examples/examples01/static/js/codemirror/mode/sieve/sieve.js +156 -0
  125. data/examples/examples01/static/js/codemirror/mode/smalltalk/index.html +57 -0
  126. data/examples/examples01/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
  127. data/examples/examples01/static/js/codemirror/mode/smarty/index.html +83 -0
  128. data/examples/examples01/static/js/codemirror/mode/smarty/smarty.js +148 -0
  129. data/examples/examples01/static/js/codemirror/mode/sparql/index.html +42 -0
  130. data/examples/examples01/static/js/codemirror/mode/sparql/sparql.js +143 -0
  131. data/examples/examples01/static/js/codemirror/mode/stex/index.html +98 -0
  132. data/examples/examples01/static/js/codemirror/mode/stex/stex.js +175 -0
  133. data/examples/examples01/static/js/codemirror/mode/stex/test.js +343 -0
  134. data/examples/examples01/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
  135. data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  136. data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  137. data/examples/examples01/static/js/codemirror/mode/tiki/index.html +81 -0
  138. data/examples/examples01/static/js/codemirror/mode/tiki/tiki.css +26 -0
  139. data/examples/examples01/static/js/codemirror/mode/tiki/tiki.js +309 -0
  140. data/examples/examples01/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
  141. data/examples/examples01/static/js/codemirror/mode/vb/index.html +88 -0
  142. data/examples/examples01/static/js/codemirror/mode/vb/vb.js +260 -0
  143. data/examples/examples01/static/js/codemirror/mode/vbscript/index.html +42 -0
  144. data/examples/examples01/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
  145. data/examples/examples01/static/js/codemirror/mode/velocity/index.html +103 -0
  146. data/examples/examples01/static/js/codemirror/mode/velocity/velocity.js +144 -0
  147. data/examples/examples01/static/js/codemirror/mode/verilog/index.html +210 -0
  148. data/examples/examples01/static/js/codemirror/mode/verilog/verilog.js +182 -0
  149. data/examples/examples01/static/js/codemirror/mode/xml/index.html +45 -0
  150. data/examples/examples01/static/js/codemirror/mode/xml/xml.js +324 -0
  151. data/examples/examples01/static/js/codemirror/mode/xquery/LICENSE +20 -0
  152. data/examples/examples01/static/js/codemirror/mode/xquery/index.html +221 -0
  153. data/examples/examples01/static/js/codemirror/mode/xquery/test.js +77 -0
  154. data/examples/examples01/static/js/codemirror/mode/xquery/xquery.js +450 -0
  155. data/examples/examples01/static/js/codemirror/mode/yaml/index.html +68 -0
  156. data/examples/examples01/static/js/codemirror/mode/yaml/yaml.js +95 -0
  157. data/examples/examples01/static/js/codemirror/mode/z80/index.html +39 -0
  158. data/examples/examples01/static/js/codemirror/mode/z80/z80.js +113 -0
  159. data/examples/examples01/static/js/codemirror/theme/ambiance-mobile.css +6 -0
  160. data/examples/examples01/static/js/codemirror/theme/ambiance.css +76 -0
  161. data/examples/examples01/static/js/codemirror/theme/blackboard.css +25 -0
  162. data/examples/examples01/static/js/codemirror/theme/cobalt.css +18 -0
  163. data/examples/examples01/static/js/codemirror/theme/eclipse.css +25 -0
  164. data/examples/examples01/static/js/codemirror/theme/elegant.css +10 -0
  165. data/examples/examples01/static/js/codemirror/theme/erlang-dark.css +21 -0
  166. data/examples/examples01/static/js/codemirror/theme/lesser-dark.css +44 -0
  167. data/examples/examples01/static/js/codemirror/theme/monokai.css +28 -0
  168. data/examples/examples01/static/js/codemirror/theme/neat.css +9 -0
  169. data/examples/examples01/static/js/codemirror/theme/night.css +21 -0
  170. data/examples/examples01/static/js/codemirror/theme/rubyblue.css +21 -0
  171. data/examples/examples01/static/js/codemirror/theme/solarized.css +207 -0
  172. data/examples/examples01/static/js/codemirror/theme/twilight.css +26 -0
  173. data/examples/examples01/static/js/codemirror/theme/vibrant-ink.css +27 -0
  174. data/examples/examples01/static/js/codemirror/theme/xq-dark.css +46 -0
  175. data/examples/examples01/static/js/d3.v3.min.js +2 -2
  176. data/examples/examples01/static/test/cm.html +33 -0
  177. data/examples/examples01/views/about.slim +15 -0
  178. data/examples/examples01/views/index.slim +1 -1
  179. data/examples/examples01/views/layout.slim +1 -0
  180. data/examples/examples01/views/layout_cm.slim +17 -0
  181. data/examples/examples01/views/navbar.slim +4 -4
  182. data/lib/swagr/version.rb +1 -1
  183. data/templates/app.rb +4 -0
  184. data/templates/static/js/codemirror/keymap/emacs.js +30 -0
  185. data/templates/static/js/codemirror/keymap/vim.js +2298 -0
  186. data/templates/static/js/codemirror/lib/codemirror.css +239 -0
  187. data/templates/static/js/codemirror/lib/codemirror.js +4553 -0
  188. data/templates/static/js/codemirror/lib/util/closetag.js +85 -0
  189. data/templates/static/js/codemirror/lib/util/colorize.js +29 -0
  190. data/templates/static/js/codemirror/lib/util/continuecomment.js +36 -0
  191. data/templates/static/js/codemirror/lib/util/continuelist.js +28 -0
  192. data/templates/static/js/codemirror/lib/util/dialog.css +32 -0
  193. data/templates/static/js/codemirror/lib/util/dialog.js +75 -0
  194. data/templates/static/js/codemirror/lib/util/foldcode.js +182 -0
  195. data/templates/static/js/codemirror/lib/util/formatting.js +108 -0
  196. data/templates/static/js/codemirror/lib/util/javascript-hint.js +137 -0
  197. data/templates/static/js/codemirror/lib/util/loadmode.js +51 -0
  198. data/templates/static/js/codemirror/lib/util/match-highlighter.js +46 -0
  199. data/templates/static/js/codemirror/lib/util/matchbrackets.js +63 -0
  200. data/templates/static/js/codemirror/lib/util/multiplex.js +95 -0
  201. data/templates/static/js/codemirror/lib/util/overlay.js +59 -0
  202. data/templates/static/js/codemirror/lib/util/pig-hint.js +117 -0
  203. data/templates/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
  204. data/templates/static/js/codemirror/lib/util/runmode.js +52 -0
  205. data/templates/static/js/codemirror/lib/util/search.js +119 -0
  206. data/templates/static/js/codemirror/lib/util/searchcursor.js +119 -0
  207. data/templates/static/js/codemirror/lib/util/simple-hint.css +16 -0
  208. data/templates/static/js/codemirror/lib/util/simple-hint.js +102 -0
  209. data/templates/static/js/codemirror/lib/util/xml-hint.js +131 -0
  210. data/templates/static/js/codemirror/mode/clike/clike.js +300 -0
  211. data/templates/static/js/codemirror/mode/clike/index.html +103 -0
  212. data/templates/static/js/codemirror/mode/clike/scala.html +767 -0
  213. data/templates/static/js/codemirror/mode/clojure/clojure.js +206 -0
  214. data/templates/static/js/codemirror/mode/clojure/index.html +67 -0
  215. data/templates/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
  216. data/templates/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
  217. data/templates/static/js/codemirror/mode/coffeescript/index.html +728 -0
  218. data/templates/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
  219. data/templates/static/js/codemirror/mode/commonlisp/index.html +165 -0
  220. data/templates/static/js/codemirror/mode/css/css.js +465 -0
  221. data/templates/static/js/codemirror/mode/css/index.html +58 -0
  222. data/templates/static/js/codemirror/mode/css/test.js +501 -0
  223. data/templates/static/js/codemirror/mode/diff/diff.js +32 -0
  224. data/templates/static/js/codemirror/mode/diff/index.html +105 -0
  225. data/templates/static/js/codemirror/mode/ecl/ecl.js +192 -0
  226. data/templates/static/js/codemirror/mode/ecl/index.html +39 -0
  227. data/templates/static/js/codemirror/mode/erlang/erlang.js +463 -0
  228. data/templates/static/js/codemirror/mode/erlang/index.html +64 -0
  229. data/templates/static/js/codemirror/mode/gfm/gfm.js +94 -0
  230. data/templates/static/js/codemirror/mode/gfm/index.html +70 -0
  231. data/templates/static/js/codemirror/mode/gfm/test.js +225 -0
  232. data/templates/static/js/codemirror/mode/go/go.js +165 -0
  233. data/templates/static/js/codemirror/mode/go/index.html +74 -0
  234. data/templates/static/js/codemirror/mode/groovy/groovy.js +210 -0
  235. data/templates/static/js/codemirror/mode/groovy/index.html +73 -0
  236. data/templates/static/js/codemirror/mode/haskell/haskell.js +242 -0
  237. data/templates/static/js/codemirror/mode/haskell/index.html +62 -0
  238. data/templates/static/js/codemirror/mode/haxe/haxe.js +429 -0
  239. data/templates/static/js/codemirror/mode/haxe/index.html +90 -0
  240. data/templates/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
  241. data/templates/static/js/codemirror/mode/htmlembedded/index.html +49 -0
  242. data/templates/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
  243. data/templates/static/js/codemirror/mode/htmlmixed/index.html +52 -0
  244. data/templates/static/js/codemirror/mode/http/http.js +98 -0
  245. data/templates/static/js/codemirror/mode/http/index.html +32 -0
  246. data/templates/static/js/codemirror/mode/javascript/index.html +88 -0
  247. data/templates/static/js/codemirror/mode/javascript/javascript.js +411 -0
  248. data/templates/static/js/codemirror/mode/javascript/typescript.html +48 -0
  249. data/templates/static/js/codemirror/mode/jinja2/index.html +38 -0
  250. data/templates/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
  251. data/templates/static/js/codemirror/mode/less/index.html +741 -0
  252. data/templates/static/js/codemirror/mode/less/less.js +266 -0
  253. data/templates/static/js/codemirror/mode/lua/index.html +74 -0
  254. data/templates/static/js/codemirror/mode/lua/lua.js +140 -0
  255. data/templates/static/js/codemirror/mode/markdown/index.html +344 -0
  256. data/templates/static/js/codemirror/mode/markdown/markdown.js +474 -0
  257. data/templates/static/js/codemirror/mode/markdown/test.js +1266 -0
  258. data/templates/static/js/codemirror/mode/mysql/index.html +41 -0
  259. data/templates/static/js/codemirror/mode/mysql/mysql.js +203 -0
  260. data/templates/static/js/codemirror/mode/ntriples/index.html +33 -0
  261. data/templates/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
  262. data/templates/static/js/codemirror/mode/ocaml/index.html +131 -0
  263. data/templates/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
  264. data/templates/static/js/codemirror/mode/pascal/LICENSE +7 -0
  265. data/templates/static/js/codemirror/mode/pascal/index.html +48 -0
  266. data/templates/static/js/codemirror/mode/pascal/pascal.js +94 -0
  267. data/templates/static/js/codemirror/mode/perl/LICENSE +19 -0
  268. data/templates/static/js/codemirror/mode/perl/index.html +62 -0
  269. data/templates/static/js/codemirror/mode/perl/perl.js +816 -0
  270. data/templates/static/js/codemirror/mode/php/index.html +51 -0
  271. data/templates/static/js/codemirror/mode/php/php.js +129 -0
  272. data/templates/static/js/codemirror/mode/pig/index.html +42 -0
  273. data/templates/static/js/codemirror/mode/pig/pig.js +171 -0
  274. data/templates/static/js/codemirror/mode/plsql/index.html +62 -0
  275. data/templates/static/js/codemirror/mode/plsql/plsql.js +216 -0
  276. data/templates/static/js/codemirror/mode/properties/index.html +41 -0
  277. data/templates/static/js/codemirror/mode/properties/properties.js +63 -0
  278. data/templates/static/js/codemirror/mode/python/LICENSE.txt +21 -0
  279. data/templates/static/js/codemirror/mode/python/index.html +124 -0
  280. data/templates/static/js/codemirror/mode/python/python.js +340 -0
  281. data/templates/static/js/codemirror/mode/r/LICENSE +24 -0
  282. data/templates/static/js/codemirror/mode/r/index.html +74 -0
  283. data/templates/static/js/codemirror/mode/r/r.js +141 -0
  284. data/templates/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
  285. data/templates/static/js/codemirror/mode/rpm/changes/index.html +53 -0
  286. data/templates/static/js/codemirror/mode/rpm/spec/index.html +99 -0
  287. data/templates/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
  288. data/templates/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
  289. data/templates/static/js/codemirror/mode/rst/index.html +526 -0
  290. data/templates/static/js/codemirror/mode/rst/rst.js +314 -0
  291. data/templates/static/js/codemirror/mode/ruby/LICENSE +24 -0
  292. data/templates/static/js/codemirror/mode/ruby/index.html +173 -0
  293. data/templates/static/js/codemirror/mode/ruby/ruby.js +195 -0
  294. data/templates/static/js/codemirror/mode/rust/index.html +48 -0
  295. data/templates/static/js/codemirror/mode/rust/rust.js +432 -0
  296. data/templates/static/js/codemirror/mode/scheme/index.html +65 -0
  297. data/templates/static/js/codemirror/mode/scheme/scheme.js +230 -0
  298. data/templates/static/js/codemirror/mode/shell/index.html +51 -0
  299. data/templates/static/js/codemirror/mode/shell/shell.js +118 -0
  300. data/templates/static/js/codemirror/mode/sieve/LICENSE +23 -0
  301. data/templates/static/js/codemirror/mode/sieve/index.html +81 -0
  302. data/templates/static/js/codemirror/mode/sieve/sieve.js +156 -0
  303. data/templates/static/js/codemirror/mode/smalltalk/index.html +57 -0
  304. data/templates/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
  305. data/templates/static/js/codemirror/mode/smarty/index.html +83 -0
  306. data/templates/static/js/codemirror/mode/smarty/smarty.js +148 -0
  307. data/templates/static/js/codemirror/mode/sparql/index.html +42 -0
  308. data/templates/static/js/codemirror/mode/sparql/sparql.js +143 -0
  309. data/templates/static/js/codemirror/mode/stex/index.html +98 -0
  310. data/templates/static/js/codemirror/mode/stex/stex.js +175 -0
  311. data/templates/static/js/codemirror/mode/stex/test.js +343 -0
  312. data/templates/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
  313. data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
  314. data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
  315. data/templates/static/js/codemirror/mode/tiki/index.html +81 -0
  316. data/templates/static/js/codemirror/mode/tiki/tiki.css +26 -0
  317. data/templates/static/js/codemirror/mode/tiki/tiki.js +309 -0
  318. data/templates/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
  319. data/templates/static/js/codemirror/mode/vb/index.html +88 -0
  320. data/templates/static/js/codemirror/mode/vb/vb.js +260 -0
  321. data/templates/static/js/codemirror/mode/vbscript/index.html +42 -0
  322. data/templates/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
  323. data/templates/static/js/codemirror/mode/velocity/index.html +103 -0
  324. data/templates/static/js/codemirror/mode/velocity/velocity.js +144 -0
  325. data/templates/static/js/codemirror/mode/verilog/index.html +210 -0
  326. data/templates/static/js/codemirror/mode/verilog/verilog.js +182 -0
  327. data/templates/static/js/codemirror/mode/xml/index.html +45 -0
  328. data/templates/static/js/codemirror/mode/xml/xml.js +324 -0
  329. data/templates/static/js/codemirror/mode/xquery/LICENSE +20 -0
  330. data/templates/static/js/codemirror/mode/xquery/index.html +221 -0
  331. data/templates/static/js/codemirror/mode/xquery/test.js +77 -0
  332. data/templates/static/js/codemirror/mode/xquery/xquery.js +450 -0
  333. data/templates/static/js/codemirror/mode/yaml/index.html +68 -0
  334. data/templates/static/js/codemirror/mode/yaml/yaml.js +95 -0
  335. data/templates/static/js/codemirror/mode/z80/index.html +39 -0
  336. data/templates/static/js/codemirror/mode/z80/z80.js +113 -0
  337. data/templates/static/js/codemirror/theme/ambiance-mobile.css +6 -0
  338. data/templates/static/js/codemirror/theme/ambiance.css +76 -0
  339. data/templates/static/js/codemirror/theme/blackboard.css +25 -0
  340. data/templates/static/js/codemirror/theme/cobalt.css +18 -0
  341. data/templates/static/js/codemirror/theme/eclipse.css +25 -0
  342. data/templates/static/js/codemirror/theme/elegant.css +10 -0
  343. data/templates/static/js/codemirror/theme/erlang-dark.css +21 -0
  344. data/templates/static/js/codemirror/theme/lesser-dark.css +44 -0
  345. data/templates/static/js/codemirror/theme/monokai.css +28 -0
  346. data/templates/static/js/codemirror/theme/neat.css +9 -0
  347. data/templates/static/js/codemirror/theme/night.css +21 -0
  348. data/templates/static/js/codemirror/theme/rubyblue.css +21 -0
  349. data/templates/static/js/codemirror/theme/solarized.css +207 -0
  350. data/templates/static/js/codemirror/theme/twilight.css +26 -0
  351. data/templates/static/js/codemirror/theme/vibrant-ink.css +27 -0
  352. data/templates/static/js/codemirror/theme/xq-dark.css +46 -0
  353. data/templates/static/js/d3.v3.min.js +2 -2
  354. data/templates/static/test/cm.html +33 -0
  355. data/templates/views/about.slim +15 -0
  356. data/templates/views/index.slim +1 -1
  357. data/templates/views/layout.slim +1 -0
  358. data/templates/views/navbar.slim +4 -4
  359. metadata +347 -2
@@ -0,0 +1,1266 @@
1
+ // Initiate ModeTest and set defaults
2
+ var MT = ModeTest;
3
+ MT.modeName = 'markdown';
4
+ MT.modeOptions = {};
5
+
6
+ MT.testMode(
7
+ 'plainText',
8
+ 'foo',
9
+ [
10
+ null, 'foo'
11
+ ]
12
+ );
13
+
14
+ // Code blocks using 4 spaces (regardless of CodeMirror.tabSize value)
15
+ MT.testMode(
16
+ 'codeBlocksUsing4Spaces',
17
+ ' foo',
18
+ [
19
+ null, ' ',
20
+ 'comment', 'foo'
21
+ ]
22
+ );
23
+ // Code blocks using 4 spaces with internal indentation
24
+ MT.testMode(
25
+ 'codeBlocksUsing4SpacesIndentation',
26
+ ' bar\n hello\n world\n foo\nbar',
27
+ [
28
+ null, ' ',
29
+ 'comment', 'bar',
30
+ null, ' ',
31
+ 'comment', 'hello',
32
+ null, ' ',
33
+ 'comment', 'world',
34
+ null, ' ',
35
+ 'comment', 'foo',
36
+ null, 'bar'
37
+ ]
38
+ );
39
+ // Code blocks using 4 spaces with internal indentation
40
+ MT.testMode(
41
+ 'codeBlocksUsing4SpacesIndentation',
42
+ ' foo\n bar\n hello\n world',
43
+ [
44
+ null, ' foo',
45
+ null, ' ',
46
+ 'comment', 'bar',
47
+ null, ' ',
48
+ 'comment', 'hello',
49
+ null, ' ',
50
+ 'comment', 'world'
51
+ ]
52
+ );
53
+
54
+ // Code blocks using 1 tab (regardless of CodeMirror.indentWithTabs value)
55
+ MT.testMode(
56
+ 'codeBlocksUsing1Tab',
57
+ '\tfoo',
58
+ [
59
+ null, '\t',
60
+ 'comment', 'foo'
61
+ ]
62
+ );
63
+
64
+ // Inline code using backticks
65
+ MT.testMode(
66
+ 'inlineCodeUsingBackticks',
67
+ 'foo `bar`',
68
+ [
69
+ null, 'foo ',
70
+ 'comment', '`bar`'
71
+ ]
72
+ );
73
+
74
+ // Block code using single backtick (shouldn't work)
75
+ MT.testMode(
76
+ 'blockCodeSingleBacktick',
77
+ '`\nfoo\n`',
78
+ [
79
+ 'comment', '`',
80
+ null, 'foo',
81
+ 'comment', '`'
82
+ ]
83
+ );
84
+
85
+ // Unclosed backticks
86
+ // Instead of simply marking as CODE, it would be nice to have an
87
+ // incomplete flag for CODE, that is styled slightly different.
88
+ MT.testMode(
89
+ 'unclosedBackticks',
90
+ 'foo `bar',
91
+ [
92
+ null, 'foo ',
93
+ 'comment', '`bar'
94
+ ]
95
+ );
96
+
97
+ // Per documentation: "To include a literal backtick character within a
98
+ // code span, you can use multiple backticks as the opening and closing
99
+ // delimiters"
100
+ MT.testMode(
101
+ 'doubleBackticks',
102
+ '``foo ` bar``',
103
+ [
104
+ 'comment', '``foo ` bar``'
105
+ ]
106
+ );
107
+
108
+ // Tests based on Dingus
109
+ // http://daringfireball.net/projects/markdown/dingus
110
+ //
111
+ // Multiple backticks within an inline code block
112
+ MT.testMode(
113
+ 'consecutiveBackticks',
114
+ '`foo```bar`',
115
+ [
116
+ 'comment', '`foo```bar`'
117
+ ]
118
+ );
119
+ // Multiple backticks within an inline code block with a second code block
120
+ MT.testMode(
121
+ 'consecutiveBackticks',
122
+ '`foo```bar` hello `world`',
123
+ [
124
+ 'comment', '`foo```bar`',
125
+ null, ' hello ',
126
+ 'comment', '`world`'
127
+ ]
128
+ );
129
+ // Unclosed with several different groups of backticks
130
+ MT.testMode(
131
+ 'unclosedBackticks',
132
+ '``foo ``` bar` hello',
133
+ [
134
+ 'comment', '``foo ``` bar` hello'
135
+ ]
136
+ );
137
+ // Closed with several different groups of backticks
138
+ MT.testMode(
139
+ 'closedBackticks',
140
+ '``foo ``` bar` hello`` world',
141
+ [
142
+ 'comment', '``foo ``` bar` hello``',
143
+ null, ' world'
144
+ ]
145
+ );
146
+
147
+ // atx headers
148
+ // http://daringfireball.net/projects/markdown/syntax#header
149
+ //
150
+ // H1
151
+ MT.testMode(
152
+ 'atxH1',
153
+ '# foo',
154
+ [
155
+ 'header', '# foo'
156
+ ]
157
+ );
158
+ // H2
159
+ MT.testMode(
160
+ 'atxH2',
161
+ '## foo',
162
+ [
163
+ 'header', '## foo'
164
+ ]
165
+ );
166
+ // H3
167
+ MT.testMode(
168
+ 'atxH3',
169
+ '### foo',
170
+ [
171
+ 'header', '### foo'
172
+ ]
173
+ );
174
+ // H4
175
+ MT.testMode(
176
+ 'atxH4',
177
+ '#### foo',
178
+ [
179
+ 'header', '#### foo'
180
+ ]
181
+ );
182
+ // H5
183
+ MT.testMode(
184
+ 'atxH5',
185
+ '##### foo',
186
+ [
187
+ 'header', '##### foo'
188
+ ]
189
+ );
190
+ // H6
191
+ MT.testMode(
192
+ 'atxH6',
193
+ '###### foo',
194
+ [
195
+ 'header', '###### foo'
196
+ ]
197
+ );
198
+ // H6 - 7x '#' should still be H6, per Dingus
199
+ // http://daringfireball.net/projects/markdown/dingus
200
+ MT.testMode(
201
+ 'atxH6NotH7',
202
+ '####### foo',
203
+ [
204
+ 'header', '####### foo'
205
+ ]
206
+ );
207
+
208
+ // Setext headers - H1, H2
209
+ // Per documentation, "Any number of underlining =’s or -’s will work."
210
+ // http://daringfireball.net/projects/markdown/syntax#header
211
+ // Ideally, the text would be marked as `header` as well, but this is
212
+ // not really feasible at the moment. So, instead, we're testing against
213
+ // what works today, to avoid any regressions.
214
+ //
215
+ // Check if single underlining = works
216
+ MT.testMode(
217
+ 'setextH1',
218
+ 'foo\n=',
219
+ [
220
+ null, 'foo',
221
+ 'header', '='
222
+ ]
223
+ );
224
+ // Check if 3+ ='s work
225
+ MT.testMode(
226
+ 'setextH1',
227
+ 'foo\n===',
228
+ [
229
+ null, 'foo',
230
+ 'header', '==='
231
+ ]
232
+ );
233
+ // Check if single underlining - works
234
+ MT.testMode(
235
+ 'setextH2',
236
+ 'foo\n-',
237
+ [
238
+ null, 'foo',
239
+ 'header', '-'
240
+ ]
241
+ );
242
+ // Check if 3+ -'s work
243
+ MT.testMode(
244
+ 'setextH2',
245
+ 'foo\n---',
246
+ [
247
+ null, 'foo',
248
+ 'header', '---'
249
+ ]
250
+ );
251
+
252
+ // Single-line blockquote with trailing space
253
+ MT.testMode(
254
+ 'blockquoteSpace',
255
+ '> foo',
256
+ [
257
+ 'quote', '> foo'
258
+ ]
259
+ );
260
+
261
+ // Single-line blockquote
262
+ MT.testMode(
263
+ 'blockquoteNoSpace',
264
+ '>foo',
265
+ [
266
+ 'quote', '>foo'
267
+ ]
268
+ );
269
+
270
+ // Single-line blockquote followed by normal paragraph
271
+ MT.testMode(
272
+ 'blockquoteThenParagraph',
273
+ '>foo\n\nbar',
274
+ [
275
+ 'quote', '>foo',
276
+ null, 'bar'
277
+ ]
278
+ );
279
+
280
+ // Multi-line blockquote (lazy mode)
281
+ MT.testMode(
282
+ 'multiBlockquoteLazy',
283
+ '>foo\nbar',
284
+ [
285
+ 'quote', '>foo',
286
+ 'quote', 'bar'
287
+ ]
288
+ );
289
+
290
+ // Multi-line blockquote followed by normal paragraph (lazy mode)
291
+ MT.testMode(
292
+ 'multiBlockquoteLazyThenParagraph',
293
+ '>foo\nbar\n\nhello',
294
+ [
295
+ 'quote', '>foo',
296
+ 'quote', 'bar',
297
+ null, 'hello'
298
+ ]
299
+ );
300
+
301
+ // Multi-line blockquote (non-lazy mode)
302
+ MT.testMode(
303
+ 'multiBlockquote',
304
+ '>foo\n>bar',
305
+ [
306
+ 'quote', '>foo',
307
+ 'quote', '>bar'
308
+ ]
309
+ );
310
+
311
+ // Multi-line blockquote followed by normal paragraph (non-lazy mode)
312
+ MT.testMode(
313
+ 'multiBlockquoteThenParagraph',
314
+ '>foo\n>bar\n\nhello',
315
+ [
316
+ 'quote', '>foo',
317
+ 'quote', '>bar',
318
+ null, 'hello'
319
+ ]
320
+ );
321
+
322
+ // Check list types
323
+ MT.testMode(
324
+ 'listAsterisk',
325
+ '* foo\n* bar',
326
+ [
327
+ 'string', '* foo',
328
+ 'string', '* bar'
329
+ ]
330
+ );
331
+ MT.testMode(
332
+ 'listPlus',
333
+ '+ foo\n+ bar',
334
+ [
335
+ 'string', '+ foo',
336
+ 'string', '+ bar'
337
+ ]
338
+ );
339
+ MT.testMode(
340
+ 'listDash',
341
+ '- foo\n- bar',
342
+ [
343
+ 'string', '- foo',
344
+ 'string', '- bar'
345
+ ]
346
+ );
347
+ MT.testMode(
348
+ 'listNumber',
349
+ '1. foo\n2. bar',
350
+ [
351
+ 'string', '1. foo',
352
+ 'string', '2. bar'
353
+ ]
354
+ );
355
+
356
+ // Formatting in lists (*)
357
+ MT.testMode(
358
+ 'listAsteriskFormatting',
359
+ '* *foo* bar\n\n* **foo** bar\n\n* ***foo*** bar\n\n* `foo` bar',
360
+ [
361
+ 'string', '* ',
362
+ 'string em', '*foo*',
363
+ 'string', ' bar',
364
+ 'string', '* ',
365
+ 'string strong', '**foo**',
366
+ 'string', ' bar',
367
+ 'string', '* ',
368
+ 'string strong', '**',
369
+ 'string emstrong', '*foo**',
370
+ 'string em', '*',
371
+ 'string', ' bar',
372
+ 'string', '* ',
373
+ 'string comment', '`foo`',
374
+ 'string', ' bar'
375
+ ]
376
+ );
377
+ // Formatting in lists (+)
378
+ MT.testMode(
379
+ 'listPlusFormatting',
380
+ '+ *foo* bar\n\n+ **foo** bar\n\n+ ***foo*** bar\n\n+ `foo` bar',
381
+ [
382
+ 'string', '+ ',
383
+ 'string em', '*foo*',
384
+ 'string', ' bar',
385
+ 'string', '+ ',
386
+ 'string strong', '**foo**',
387
+ 'string', ' bar',
388
+ 'string', '+ ',
389
+ 'string strong', '**',
390
+ 'string emstrong', '*foo**',
391
+ 'string em', '*',
392
+ 'string', ' bar',
393
+ 'string', '+ ',
394
+ 'string comment', '`foo`',
395
+ 'string', ' bar'
396
+ ]
397
+ );
398
+ // Formatting in lists (-)
399
+ MT.testMode(
400
+ 'listDashFormatting',
401
+ '- *foo* bar\n\n- **foo** bar\n\n- ***foo*** bar\n\n- `foo` bar',
402
+ [
403
+ 'string', '- ',
404
+ 'string em', '*foo*',
405
+ 'string', ' bar',
406
+ 'string', '- ',
407
+ 'string strong', '**foo**',
408
+ 'string', ' bar',
409
+ 'string', '- ',
410
+ 'string strong', '**',
411
+ 'string emstrong', '*foo**',
412
+ 'string em', '*',
413
+ 'string', ' bar',
414
+ 'string', '- ',
415
+ 'string comment', '`foo`',
416
+ 'string', ' bar'
417
+ ]
418
+ );
419
+ // Formatting in lists (1.)
420
+ MT.testMode(
421
+ 'listNumberFormatting',
422
+ '1. *foo* bar\n\n2. **foo** bar\n\n3. ***foo*** bar\n\n4. `foo` bar',
423
+ [
424
+ 'string', '1. ',
425
+ 'string em', '*foo*',
426
+ 'string', ' bar',
427
+ 'string', '2. ',
428
+ 'string strong', '**foo**',
429
+ 'string', ' bar',
430
+ 'string', '3. ',
431
+ 'string strong', '**',
432
+ 'string emstrong', '*foo**',
433
+ 'string em', '*',
434
+ 'string', ' bar',
435
+ 'string', '4. ',
436
+ 'string comment', '`foo`',
437
+ 'string', ' bar'
438
+ ]
439
+ );
440
+
441
+ // Paragraph lists
442
+ MT.testMode(
443
+ 'listParagraph',
444
+ '* foo\n\n* bar',
445
+ [
446
+ 'string', '* foo',
447
+ 'string', '* bar'
448
+ ]
449
+ );
450
+
451
+ // Multi-paragraph lists
452
+ //
453
+ // 4 spaces
454
+ MT.testMode(
455
+ 'listMultiParagraph',
456
+ '* foo\n\n* bar\n\n hello',
457
+ [
458
+ 'string', '* foo',
459
+ 'string', '* bar',
460
+ null, ' ',
461
+ 'string', 'hello'
462
+ ]
463
+ );
464
+ // 4 spaces, extra blank lines (should still be list, per Dingus)
465
+ MT.testMode(
466
+ 'listMultiParagraphExtra',
467
+ '* foo\n\n* bar\n\n\n hello',
468
+ [
469
+ 'string', '* foo',
470
+ 'string', '* bar',
471
+ null, ' ',
472
+ 'string', 'hello'
473
+ ]
474
+ );
475
+ // 4 spaces, plus 1 space (should still be list, per Dingus)
476
+ MT.testMode(
477
+ 'listMultiParagraphExtraSpace',
478
+ '* foo\n\n* bar\n\n hello\n\n world',
479
+ [
480
+ 'string', '* foo',
481
+ 'string', '* bar',
482
+ null, ' ',
483
+ 'string', 'hello',
484
+ null, ' ',
485
+ 'string', 'world'
486
+ ]
487
+ );
488
+ // 1 tab
489
+ MT.testMode(
490
+ 'listTab',
491
+ '* foo\n\n* bar\n\n\thello',
492
+ [
493
+ 'string', '* foo',
494
+ 'string', '* bar',
495
+ null, '\t',
496
+ 'string', 'hello'
497
+ ]
498
+ );
499
+ // No indent
500
+ MT.testMode(
501
+ 'listNoIndent',
502
+ '* foo\n\n* bar\n\nhello',
503
+ [
504
+ 'string', '* foo',
505
+ 'string', '* bar',
506
+ null, 'hello'
507
+ ]
508
+ );
509
+ // Blockquote
510
+ MT.testMode(
511
+ 'blockquote',
512
+ '* foo\n\n* bar\n\n > hello',
513
+ [
514
+ 'string', '* foo',
515
+ 'string', '* bar',
516
+ null, ' ',
517
+ 'string quote', '> hello'
518
+ ]
519
+ );
520
+ // Code block
521
+ MT.testMode(
522
+ 'blockquoteCode',
523
+ '* foo\n\n* bar\n\n > hello\n\n world',
524
+ [
525
+ 'string', '* foo',
526
+ 'string', '* bar',
527
+ null, ' ',
528
+ 'comment', '> hello',
529
+ null, ' ',
530
+ 'string', 'world'
531
+ ]
532
+ );
533
+ // Code block followed by text
534
+ MT.testMode(
535
+ 'blockquoteCodeText',
536
+ '* foo\n\n bar\n\n hello\n\n world',
537
+ [
538
+ 'string', '* foo',
539
+ null, ' ',
540
+ 'string', 'bar',
541
+ null, ' ',
542
+ 'comment', 'hello',
543
+ null, ' ',
544
+ 'string', 'world'
545
+ ]
546
+ );
547
+
548
+ // Nested list
549
+ //
550
+ // *
551
+ MT.testMode(
552
+ 'listAsteriskNested',
553
+ '* foo\n\n * bar',
554
+ [
555
+ 'string', '* foo',
556
+ null, ' ',
557
+ 'string', '* bar'
558
+ ]
559
+ );
560
+ // +
561
+ MT.testMode(
562
+ 'listPlusNested',
563
+ '+ foo\n\n + bar',
564
+ [
565
+ 'string', '+ foo',
566
+ null, ' ',
567
+ 'string', '+ bar'
568
+ ]
569
+ );
570
+ // -
571
+ MT.testMode(
572
+ 'listDashNested',
573
+ '- foo\n\n - bar',
574
+ [
575
+ 'string', '- foo',
576
+ null, ' ',
577
+ 'string', '- bar'
578
+ ]
579
+ );
580
+ // 1.
581
+ MT.testMode(
582
+ 'listNumberNested',
583
+ '1. foo\n\n 2. bar',
584
+ [
585
+ 'string', '1. foo',
586
+ null, ' ',
587
+ 'string', '2. bar'
588
+ ]
589
+ );
590
+ // Mixed
591
+ MT.testMode(
592
+ 'listMixed',
593
+ '* foo\n\n + bar\n\n - hello\n\n 1. world',
594
+ [
595
+ 'string', '* foo',
596
+ null, ' ',
597
+ 'string', '+ bar',
598
+ null, ' ',
599
+ 'string', '- hello',
600
+ null, ' ',
601
+ 'string', '1. world'
602
+ ]
603
+ );
604
+ // Blockquote
605
+ MT.testMode(
606
+ 'listBlockquote',
607
+ '* foo\n\n + bar\n\n > hello',
608
+ [
609
+ 'string', '* foo',
610
+ null, ' ',
611
+ 'string', '+ bar',
612
+ null, ' ',
613
+ 'quote string', '> hello'
614
+ ]
615
+ );
616
+ // Code
617
+ MT.testMode(
618
+ 'listCode',
619
+ '* foo\n\n + bar\n\n hello',
620
+ [
621
+ 'string', '* foo',
622
+ null, ' ',
623
+ 'string', '+ bar',
624
+ null, ' ',
625
+ 'comment', 'hello'
626
+ ]
627
+ );
628
+ // Code with internal indentation
629
+ MT.testMode(
630
+ 'listCodeIndentation',
631
+ '* foo\n\n bar\n hello\n world\n foo\n bar',
632
+ [
633
+ 'string', '* foo',
634
+ null, ' ',
635
+ 'comment', 'bar',
636
+ null, ' ',
637
+ 'comment', 'hello',
638
+ null, ' ',
639
+ 'comment', 'world',
640
+ null, ' ',
641
+ 'comment', 'foo',
642
+ null, ' ',
643
+ 'string', 'bar'
644
+ ]
645
+ );
646
+ // Code followed by text
647
+ MT.testMode(
648
+ 'listCodeText',
649
+ '* foo\n\n bar\n\nhello',
650
+ [
651
+ 'string', '* foo',
652
+ null, ' ',
653
+ 'comment', 'bar',
654
+ null, 'hello'
655
+ ]
656
+ );
657
+
658
+ // Following tests directly from official Markdown documentation
659
+ // http://daringfireball.net/projects/markdown/syntax#hr
660
+ MT.testMode(
661
+ 'hrSpace',
662
+ '* * *',
663
+ [
664
+ 'hr', '* * *'
665
+ ]
666
+ );
667
+
668
+ MT.testMode(
669
+ 'hr',
670
+ '***',
671
+ [
672
+ 'hr', '***'
673
+ ]
674
+ );
675
+
676
+ MT.testMode(
677
+ 'hrLong',
678
+ '*****',
679
+ [
680
+ 'hr', '*****'
681
+ ]
682
+ );
683
+
684
+ MT.testMode(
685
+ 'hrSpaceDash',
686
+ '- - -',
687
+ [
688
+ 'hr', '- - -'
689
+ ]
690
+ );
691
+
692
+ MT.testMode(
693
+ 'hrDashLong',
694
+ '---------------------------------------',
695
+ [
696
+ 'hr', '---------------------------------------'
697
+ ]
698
+ );
699
+
700
+ // Inline link with title
701
+ MT.testMode(
702
+ 'linkTitle',
703
+ '[foo](http://example.com/ "bar") hello',
704
+ [
705
+ 'link', '[foo]',
706
+ 'string', '(http://example.com/ "bar")',
707
+ null, ' hello'
708
+ ]
709
+ );
710
+
711
+ // Inline link without title
712
+ MT.testMode(
713
+ 'linkNoTitle',
714
+ '[foo](http://example.com/) bar',
715
+ [
716
+ 'link', '[foo]',
717
+ 'string', '(http://example.com/)',
718
+ null, ' bar'
719
+ ]
720
+ );
721
+
722
+ // Inline link with Em
723
+ MT.testMode(
724
+ 'linkEm',
725
+ '[*foo*](http://example.com/) bar',
726
+ [
727
+ 'link', '[',
728
+ 'link em', '*foo*',
729
+ 'link', ']',
730
+ 'string', '(http://example.com/)',
731
+ null, ' bar'
732
+ ]
733
+ );
734
+
735
+ // Inline link with Strong
736
+ MT.testMode(
737
+ 'linkStrong',
738
+ '[**foo**](http://example.com/) bar',
739
+ [
740
+ 'link', '[',
741
+ 'link strong', '**foo**',
742
+ 'link', ']',
743
+ 'string', '(http://example.com/)',
744
+ null, ' bar'
745
+ ]
746
+ );
747
+
748
+ // Inline link with EmStrong
749
+ MT.testMode(
750
+ 'linkEmStrong',
751
+ '[***foo***](http://example.com/) bar',
752
+ [
753
+ 'link', '[',
754
+ 'link strong', '**',
755
+ 'link emstrong', '*foo**',
756
+ 'link em', '*',
757
+ 'link', ']',
758
+ 'string', '(http://example.com/)',
759
+ null, ' bar'
760
+ ]
761
+ );
762
+
763
+ // Image with title
764
+ MT.testMode(
765
+ 'imageTitle',
766
+ '![foo](http://example.com/ "bar") hello',
767
+ [
768
+ 'tag', '![foo]',
769
+ 'string', '(http://example.com/ "bar")',
770
+ null, ' hello'
771
+ ]
772
+ );
773
+
774
+ // Image without title
775
+ MT.testMode(
776
+ 'imageNoTitle',
777
+ '![foo](http://example.com/) bar',
778
+ [
779
+ 'tag', '![foo]',
780
+ 'string', '(http://example.com/)',
781
+ null, ' bar'
782
+ ]
783
+ );
784
+
785
+ // Image with asterisks
786
+ MT.testMode(
787
+ 'imageAsterisks',
788
+ '![*foo*](http://example.com/) bar',
789
+ [
790
+ 'tag', '![*foo*]',
791
+ 'string', '(http://example.com/)',
792
+ null, ' bar'
793
+ ]
794
+ );
795
+
796
+ // Not a link. Should be normal text due to square brackets being used
797
+ // regularly in text, especially in quoted material, and no space is allowed
798
+ // between square brackets and parentheses (per Dingus).
799
+ MT.testMode(
800
+ 'notALink',
801
+ '[foo] (bar)',
802
+ [
803
+ null, '[foo] (bar)'
804
+ ]
805
+ );
806
+
807
+ // Reference-style links
808
+ MT.testMode(
809
+ 'linkReference',
810
+ '[foo][bar] hello',
811
+ [
812
+ 'link', '[foo]',
813
+ 'string', '[bar]',
814
+ null, ' hello'
815
+ ]
816
+ );
817
+ // Reference-style links with Em
818
+ MT.testMode(
819
+ 'linkReferenceEm',
820
+ '[*foo*][bar] hello',
821
+ [
822
+ 'link', '[',
823
+ 'link em', '*foo*',
824
+ 'link', ']',
825
+ 'string', '[bar]',
826
+ null, ' hello'
827
+ ]
828
+ );
829
+ // Reference-style links with Strong
830
+ MT.testMode(
831
+ 'linkReferenceStrong',
832
+ '[**foo**][bar] hello',
833
+ [
834
+ 'link', '[',
835
+ 'link strong', '**foo**',
836
+ 'link', ']',
837
+ 'string', '[bar]',
838
+ null, ' hello'
839
+ ]
840
+ );
841
+ // Reference-style links with EmStrong
842
+ MT.testMode(
843
+ 'linkReferenceEmStrong',
844
+ '[***foo***][bar] hello',
845
+ [
846
+ 'link', '[',
847
+ 'link strong', '**',
848
+ 'link emstrong', '*foo**',
849
+ 'link em', '*',
850
+ 'link', ']',
851
+ 'string', '[bar]',
852
+ null, ' hello'
853
+ ]
854
+ );
855
+
856
+ // Reference-style links with optional space separator (per docuentation)
857
+ // "You can optionally use a space to separate the sets of brackets"
858
+ MT.testMode(
859
+ 'linkReferenceSpace',
860
+ '[foo] [bar] hello',
861
+ [
862
+ 'link', '[foo]',
863
+ null, ' ',
864
+ 'string', '[bar]',
865
+ null, ' hello'
866
+ ]
867
+ );
868
+ // Should only allow a single space ("...use *a* space...")
869
+ MT.testMode(
870
+ 'linkReferenceDoubleSpace',
871
+ '[foo] [bar] hello',
872
+ [
873
+ null, '[foo] [bar] hello'
874
+ ]
875
+ );
876
+
877
+ // Reference-style links with implicit link name
878
+ MT.testMode(
879
+ 'linkImplicit',
880
+ '[foo][] hello',
881
+ [
882
+ 'link', '[foo]',
883
+ 'string', '[]',
884
+ null, ' hello'
885
+ ]
886
+ );
887
+
888
+ // @todo It would be nice if, at some point, the document was actually
889
+ // checked to see if the referenced link exists
890
+
891
+ // Link label, for reference-style links (taken from documentation)
892
+ //
893
+ // No title
894
+ MT.testMode(
895
+ 'labelNoTitle',
896
+ '[foo]: http://example.com/',
897
+ [
898
+ 'link', '[foo]:',
899
+ null, ' ',
900
+ 'string', 'http://example.com/'
901
+ ]
902
+ );
903
+ // Space in ID and title
904
+ MT.testMode(
905
+ 'labelSpaceTitle',
906
+ '[foo bar]: http://example.com/ "hello"',
907
+ [
908
+ 'link', '[foo bar]:',
909
+ null, ' ',
910
+ 'string', 'http://example.com/ "hello"'
911
+ ]
912
+ );
913
+ // Double title
914
+ MT.testMode(
915
+ 'labelDoubleTitle',
916
+ '[foo bar]: http://example.com/ "hello" "world"',
917
+ [
918
+ 'link', '[foo bar]:',
919
+ null, ' ',
920
+ 'string', 'http://example.com/ "hello"',
921
+ null, ' "world"'
922
+ ]
923
+ );
924
+ // Double quotes around title
925
+ MT.testMode(
926
+ 'labelTitleDoubleQuotes',
927
+ '[foo]: http://example.com/ "bar"',
928
+ [
929
+ 'link', '[foo]:',
930
+ null, ' ',
931
+ 'string', 'http://example.com/ "bar"'
932
+ ]
933
+ );
934
+ // Single quotes around title
935
+ MT.testMode(
936
+ 'labelTitleSingleQuotes',
937
+ '[foo]: http://example.com/ \'bar\'',
938
+ [
939
+ 'link', '[foo]:',
940
+ null, ' ',
941
+ 'string', 'http://example.com/ \'bar\''
942
+ ]
943
+ );
944
+ // Parentheses around title
945
+ MT.testMode(
946
+ 'labelTitleParenthese',
947
+ '[foo]: http://example.com/ (bar)',
948
+ [
949
+ 'link', '[foo]:',
950
+ null, ' ',
951
+ 'string', 'http://example.com/ (bar)'
952
+ ]
953
+ );
954
+ // Invalid title
955
+ MT.testMode(
956
+ 'labelTitleInvalid',
957
+ '[foo]: http://example.com/ bar',
958
+ [
959
+ 'link', '[foo]:',
960
+ null, ' ',
961
+ 'string', 'http://example.com/',
962
+ null, ' bar'
963
+ ]
964
+ );
965
+ // Angle brackets around URL
966
+ MT.testMode(
967
+ 'labelLinkAngleBrackets',
968
+ '[foo]: <http://example.com/> "bar"',
969
+ [
970
+ 'link', '[foo]:',
971
+ null, ' ',
972
+ 'string', '<http://example.com/> "bar"'
973
+ ]
974
+ );
975
+ // Title on next line per documentation (double quotes)
976
+ MT.testMode(
977
+ 'labelTitleNextDoubleQuotes',
978
+ '[foo]: http://example.com/\n"bar" hello',
979
+ [
980
+ 'link', '[foo]:',
981
+ null, ' ',
982
+ 'string', 'http://example.com/',
983
+ 'string', '"bar"',
984
+ null, ' hello'
985
+ ]
986
+ );
987
+ // Title on next line per documentation (single quotes)
988
+ MT.testMode(
989
+ 'labelTitleNextSingleQuotes',
990
+ '[foo]: http://example.com/\n\'bar\' hello',
991
+ [
992
+ 'link', '[foo]:',
993
+ null, ' ',
994
+ 'string', 'http://example.com/',
995
+ 'string', '\'bar\'',
996
+ null, ' hello'
997
+ ]
998
+ );
999
+ // Title on next line per documentation (parentheses)
1000
+ MT.testMode(
1001
+ 'labelTitleNextParenthese',
1002
+ '[foo]: http://example.com/\n(bar) hello',
1003
+ [
1004
+ 'link', '[foo]:',
1005
+ null, ' ',
1006
+ 'string', 'http://example.com/',
1007
+ 'string', '(bar)',
1008
+ null, ' hello'
1009
+ ]
1010
+ );
1011
+ // Title on next line per documentation (mixed)
1012
+ MT.testMode(
1013
+ 'labelTitleNextMixed',
1014
+ '[foo]: http://example.com/\n(bar" hello',
1015
+ [
1016
+ 'link', '[foo]:',
1017
+ null, ' ',
1018
+ 'string', 'http://example.com/',
1019
+ null, '(bar" hello'
1020
+ ]
1021
+ );
1022
+
1023
+ // Automatic links
1024
+ MT.testMode(
1025
+ 'linkWeb',
1026
+ '<http://example.com/> foo',
1027
+ [
1028
+ 'link', '<http://example.com/>',
1029
+ null, ' foo'
1030
+ ]
1031
+ );
1032
+
1033
+ // Automatic email links
1034
+ MT.testMode(
1035
+ 'linkEmail',
1036
+ '<user@example.com> foo',
1037
+ [
1038
+ 'link', '<user@example.com>',
1039
+ null, ' foo'
1040
+ ]
1041
+ );
1042
+
1043
+ // Single asterisk
1044
+ MT.testMode(
1045
+ 'emAsterisk',
1046
+ '*foo* bar',
1047
+ [
1048
+ 'em', '*foo*',
1049
+ null, ' bar'
1050
+ ]
1051
+ );
1052
+
1053
+ // Single underscore
1054
+ MT.testMode(
1055
+ 'emUnderscore',
1056
+ '_foo_ bar',
1057
+ [
1058
+ 'em', '_foo_',
1059
+ null, ' bar'
1060
+ ]
1061
+ );
1062
+
1063
+ // Emphasis characters within a word
1064
+ MT.testMode(
1065
+ 'emInWordAsterisk',
1066
+ 'foo*bar*hello',
1067
+ [
1068
+ null, 'foo',
1069
+ 'em', '*bar*',
1070
+ null, 'hello'
1071
+ ]
1072
+ );
1073
+ MT.testMode(
1074
+ 'emInWordUnderscore',
1075
+ 'foo_bar_hello',
1076
+ [
1077
+ null, 'foo',
1078
+ 'em', '_bar_',
1079
+ null, 'hello'
1080
+ ]
1081
+ );
1082
+ // Per documentation: "...surround an * or _ with spaces, it’ll be
1083
+ // treated as a literal asterisk or underscore."
1084
+ //
1085
+ // Inside EM
1086
+ MT.testMode(
1087
+ 'emEscapedBySpaceIn',
1088
+ 'foo _bar _ hello_ world',
1089
+ [
1090
+ null, 'foo ',
1091
+ 'em', '_bar _ hello_',
1092
+ null, ' world'
1093
+ ]
1094
+ );
1095
+ // Outside EM
1096
+ MT.testMode(
1097
+ 'emEscapedBySpaceOut',
1098
+ 'foo _ bar_hello_world',
1099
+ [
1100
+ null, 'foo _ bar',
1101
+ 'em', '_hello_',
1102
+ null, 'world'
1103
+ ]
1104
+ );
1105
+
1106
+ // Unclosed emphasis characters
1107
+ // Instead of simply marking as EM / STRONG, it would be nice to have an
1108
+ // incomplete flag for EM and STRONG, that is styled slightly different.
1109
+ MT.testMode(
1110
+ 'emIncompleteAsterisk',
1111
+ 'foo *bar',
1112
+ [
1113
+ null, 'foo ',
1114
+ 'em', '*bar'
1115
+ ]
1116
+ );
1117
+ MT.testMode(
1118
+ 'emIncompleteUnderscore',
1119
+ 'foo _bar',
1120
+ [
1121
+ null, 'foo ',
1122
+ 'em', '_bar'
1123
+ ]
1124
+ );
1125
+
1126
+ // Double asterisk
1127
+ MT.testMode(
1128
+ 'strongAsterisk',
1129
+ '**foo** bar',
1130
+ [
1131
+ 'strong', '**foo**',
1132
+ null, ' bar'
1133
+ ]
1134
+ );
1135
+
1136
+ // Double underscore
1137
+ MT.testMode(
1138
+ 'strongUnderscore',
1139
+ '__foo__ bar',
1140
+ [
1141
+ 'strong', '__foo__',
1142
+ null, ' bar'
1143
+ ]
1144
+ );
1145
+
1146
+ // Triple asterisk
1147
+ MT.testMode(
1148
+ 'emStrongAsterisk',
1149
+ '*foo**bar*hello** world',
1150
+ [
1151
+ 'em', '*foo',
1152
+ 'emstrong', '**bar*',
1153
+ 'strong', 'hello**',
1154
+ null, ' world'
1155
+ ]
1156
+ );
1157
+
1158
+ // Triple underscore
1159
+ MT.testMode(
1160
+ 'emStrongUnderscore',
1161
+ '_foo__bar_hello__ world',
1162
+ [
1163
+ 'em', '_foo',
1164
+ 'emstrong', '__bar_',
1165
+ 'strong', 'hello__',
1166
+ null, ' world'
1167
+ ]
1168
+ );
1169
+
1170
+ // Triple mixed
1171
+ // "...same character must be used to open and close an emphasis span.""
1172
+ MT.testMode(
1173
+ 'emStrongMixed',
1174
+ '_foo**bar*hello__ world',
1175
+ [
1176
+ 'em', '_foo',
1177
+ 'emstrong', '**bar*hello__ world'
1178
+ ]
1179
+ );
1180
+
1181
+ MT.testMode(
1182
+ 'emStrongMixed',
1183
+ '*foo__bar_hello** world',
1184
+ [
1185
+ 'em', '*foo',
1186
+ 'emstrong', '__bar_hello** world'
1187
+ ]
1188
+ );
1189
+
1190
+ // These characters should be escaped:
1191
+ // \ backslash
1192
+ // ` backtick
1193
+ // * asterisk
1194
+ // _ underscore
1195
+ // {} curly braces
1196
+ // [] square brackets
1197
+ // () parentheses
1198
+ // # hash mark
1199
+ // + plus sign
1200
+ // - minus sign (hyphen)
1201
+ // . dot
1202
+ // ! exclamation mark
1203
+ //
1204
+ // Backtick (code)
1205
+ MT.testMode(
1206
+ 'escapeBacktick',
1207
+ 'foo \\`bar\\`',
1208
+ [
1209
+ null, 'foo \\`bar\\`'
1210
+ ]
1211
+ );
1212
+ MT.testMode(
1213
+ 'doubleEscapeBacktick',
1214
+ 'foo \\\\`bar\\\\`',
1215
+ [
1216
+ null, 'foo \\\\',
1217
+ 'comment', '`bar\\\\`'
1218
+ ]
1219
+ );
1220
+ // Asterisk (em)
1221
+ MT.testMode(
1222
+ 'escapeAsterisk',
1223
+ 'foo \\*bar\\*',
1224
+ [
1225
+ null, 'foo \\*bar\\*'
1226
+ ]
1227
+ );
1228
+ MT.testMode(
1229
+ 'doubleEscapeAsterisk',
1230
+ 'foo \\\\*bar\\\\*',
1231
+ [
1232
+ null, 'foo \\\\',
1233
+ 'em', '*bar\\\\*'
1234
+ ]
1235
+ );
1236
+ // Underscore (em)
1237
+ MT.testMode(
1238
+ 'escapeUnderscore',
1239
+ 'foo \\_bar\\_',
1240
+ [
1241
+ null, 'foo \\_bar\\_'
1242
+ ]
1243
+ );
1244
+ MT.testMode(
1245
+ 'doubleEscapeUnderscore',
1246
+ 'foo \\\\_bar\\\\_',
1247
+ [
1248
+ null, 'foo \\\\',
1249
+ 'em', '_bar\\\\_'
1250
+ ]
1251
+ );
1252
+ // Hash mark (headers)
1253
+ MT.testMode(
1254
+ 'escapeHash',
1255
+ '\\# foo',
1256
+ [
1257
+ null, '\\# foo'
1258
+ ]
1259
+ );
1260
+ MT.testMode(
1261
+ 'doubleEscapeHash',
1262
+ '\\\\# foo',
1263
+ [
1264
+ null, '\\\\# foo'
1265
+ ]
1266
+ );