swagr 0.0.7 → 0.0.8
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/swagr +15 -0
- data/examples/examples01/app.rb +6 -2
- data/examples/examples01/coffee/data_port.coffee +2 -0
- data/examples/examples01/static/css/codemirror.css +1247 -0
- data/examples/examples01/static/js/codemirror-compressed-3-0.js +5 -0
- data/examples/examples01/static/js/codemirror/keymap/emacs.js +30 -0
- data/examples/examples01/static/js/codemirror/keymap/vim.js +2298 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.css +239 -0
- data/examples/examples01/static/js/codemirror/lib/codemirror.js +4553 -0
- data/examples/examples01/static/js/codemirror/lib/util/closetag.js +85 -0
- data/examples/examples01/static/js/codemirror/lib/util/colorize.js +29 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/examples/examples01/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.css +32 -0
- data/examples/examples01/static/js/codemirror/lib/util/dialog.js +75 -0
- data/examples/examples01/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/examples/examples01/static/js/codemirror/lib/util/formatting.js +108 -0
- data/examples/examples01/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/examples/examples01/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/examples/examples01/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/examples/examples01/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/examples/examples01/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/examples/examples01/static/js/codemirror/lib/util/overlay.js +59 -0
- data/examples/examples01/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/examples/examples01/static/js/codemirror/lib/util/runmode.js +52 -0
- data/examples/examples01/static/js/codemirror/lib/util/search.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/examples/examples01/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/examples/examples01/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/examples/examples01/static/js/codemirror/mode/clike/clike.js +300 -0
- data/examples/examples01/static/js/codemirror/mode/clike/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/clike/scala.html +767 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/examples/examples01/static/js/codemirror/mode/clojure/index.html +67 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/examples/examples01/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/examples/examples01/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/examples/examples01/static/js/codemirror/mode/css/css.js +465 -0
- data/examples/examples01/static/js/codemirror/mode/css/index.html +58 -0
- data/examples/examples01/static/js/codemirror/mode/css/test.js +501 -0
- data/examples/examples01/static/js/codemirror/mode/diff/diff.js +32 -0
- data/examples/examples01/static/js/codemirror/mode/diff/index.html +105 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/examples/examples01/static/js/codemirror/mode/ecl/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/examples/examples01/static/js/codemirror/mode/erlang/index.html +64 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/index.html +70 -0
- data/examples/examples01/static/js/codemirror/mode/gfm/test.js +225 -0
- data/examples/examples01/static/js/codemirror/mode/go/go.js +165 -0
- data/examples/examples01/static/js/codemirror/mode/go/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/examples/examples01/static/js/codemirror/mode/groovy/index.html +73 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/examples/examples01/static/js/codemirror/mode/haskell/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/examples/examples01/static/js/codemirror/mode/haxe/index.html +90 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/examples/examples01/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/examples/examples01/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/examples/examples01/static/js/codemirror/mode/http/http.js +98 -0
- data/examples/examples01/static/js/codemirror/mode/http/index.html +32 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/examples/examples01/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/examples/examples01/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/examples/examples01/static/js/codemirror/mode/less/index.html +741 -0
- data/examples/examples01/static/js/codemirror/mode/less/less.js +266 -0
- data/examples/examples01/static/js/codemirror/mode/lua/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/lua/lua.js +140 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/index.html +344 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/examples/examples01/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/examples/examples01/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/examples/examples01/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/examples/examples01/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/examples/examples01/static/js/codemirror/mode/perl/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/perl/perl.js +816 -0
- data/examples/examples01/static/js/codemirror/mode/php/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/php/php.js +129 -0
- data/examples/examples01/static/js/codemirror/mode/pig/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/pig/pig.js +171 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/index.html +62 -0
- data/examples/examples01/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/examples/examples01/static/js/codemirror/mode/properties/index.html +41 -0
- data/examples/examples01/static/js/codemirror/mode/properties/properties.js +63 -0
- data/examples/examples01/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/python/index.html +124 -0
- data/examples/examples01/static/js/codemirror/mode/python/python.js +340 -0
- data/examples/examples01/static/js/codemirror/mode/r/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/r/index.html +74 -0
- data/examples/examples01/static/js/codemirror/mode/r/r.js +141 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/examples/examples01/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/examples/examples01/static/js/codemirror/mode/rst/index.html +526 -0
- data/examples/examples01/static/js/codemirror/mode/rst/rst.js +314 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/index.html +173 -0
- data/examples/examples01/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/examples/examples01/static/js/codemirror/mode/rust/index.html +48 -0
- data/examples/examples01/static/js/codemirror/mode/rust/rust.js +432 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/index.html +65 -0
- data/examples/examples01/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/examples/examples01/static/js/codemirror/mode/shell/index.html +51 -0
- data/examples/examples01/static/js/codemirror/mode/shell/shell.js +118 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/examples/examples01/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/index.html +83 -0
- data/examples/examples01/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/examples/examples01/static/js/codemirror/mode/stex/index.html +98 -0
- data/examples/examples01/static/js/codemirror/mode/stex/stex.js +175 -0
- data/examples/examples01/static/js/codemirror/mode/stex/test.js +343 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/examples/examples01/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/index.html +81 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/examples/examples01/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/examples/examples01/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/examples/examples01/static/js/codemirror/mode/vb/index.html +88 -0
- data/examples/examples01/static/js/codemirror/mode/vb/vb.js +260 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/examples/examples01/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/index.html +103 -0
- data/examples/examples01/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/index.html +210 -0
- data/examples/examples01/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/examples/examples01/static/js/codemirror/mode/xml/index.html +45 -0
- data/examples/examples01/static/js/codemirror/mode/xml/xml.js +324 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/index.html +221 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/test.js +77 -0
- data/examples/examples01/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/index.html +68 -0
- data/examples/examples01/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/examples/examples01/static/js/codemirror/mode/z80/index.html +39 -0
- data/examples/examples01/static/js/codemirror/mode/z80/z80.js +113 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/examples/examples01/static/js/codemirror/theme/ambiance.css +76 -0
- data/examples/examples01/static/js/codemirror/theme/blackboard.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/cobalt.css +18 -0
- data/examples/examples01/static/js/codemirror/theme/eclipse.css +25 -0
- data/examples/examples01/static/js/codemirror/theme/elegant.css +10 -0
- data/examples/examples01/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/examples/examples01/static/js/codemirror/theme/monokai.css +28 -0
- data/examples/examples01/static/js/codemirror/theme/neat.css +9 -0
- data/examples/examples01/static/js/codemirror/theme/night.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/rubyblue.css +21 -0
- data/examples/examples01/static/js/codemirror/theme/solarized.css +207 -0
- data/examples/examples01/static/js/codemirror/theme/twilight.css +26 -0
- data/examples/examples01/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/examples/examples01/static/js/codemirror/theme/xq-dark.css +46 -0
- data/examples/examples01/static/js/d3.v3.min.js +2 -2
- data/examples/examples01/static/test/cm.html +33 -0
- data/examples/examples01/views/about.slim +15 -0
- data/examples/examples01/views/index.slim +1 -1
- data/examples/examples01/views/layout.slim +1 -0
- data/examples/examples01/views/layout_cm.slim +17 -0
- data/examples/examples01/views/navbar.slim +4 -4
- data/lib/swagr/version.rb +1 -1
- data/templates/app.rb +4 -0
- data/templates/static/js/codemirror/keymap/emacs.js +30 -0
- data/templates/static/js/codemirror/keymap/vim.js +2298 -0
- data/templates/static/js/codemirror/lib/codemirror.css +239 -0
- data/templates/static/js/codemirror/lib/codemirror.js +4553 -0
- data/templates/static/js/codemirror/lib/util/closetag.js +85 -0
- data/templates/static/js/codemirror/lib/util/colorize.js +29 -0
- data/templates/static/js/codemirror/lib/util/continuecomment.js +36 -0
- data/templates/static/js/codemirror/lib/util/continuelist.js +28 -0
- data/templates/static/js/codemirror/lib/util/dialog.css +32 -0
- data/templates/static/js/codemirror/lib/util/dialog.js +75 -0
- data/templates/static/js/codemirror/lib/util/foldcode.js +182 -0
- data/templates/static/js/codemirror/lib/util/formatting.js +108 -0
- data/templates/static/js/codemirror/lib/util/javascript-hint.js +137 -0
- data/templates/static/js/codemirror/lib/util/loadmode.js +51 -0
- data/templates/static/js/codemirror/lib/util/match-highlighter.js +46 -0
- data/templates/static/js/codemirror/lib/util/matchbrackets.js +63 -0
- data/templates/static/js/codemirror/lib/util/multiplex.js +95 -0
- data/templates/static/js/codemirror/lib/util/overlay.js +59 -0
- data/templates/static/js/codemirror/lib/util/pig-hint.js +117 -0
- data/templates/static/js/codemirror/lib/util/runmode-standalone.js +90 -0
- data/templates/static/js/codemirror/lib/util/runmode.js +52 -0
- data/templates/static/js/codemirror/lib/util/search.js +119 -0
- data/templates/static/js/codemirror/lib/util/searchcursor.js +119 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.css +16 -0
- data/templates/static/js/codemirror/lib/util/simple-hint.js +102 -0
- data/templates/static/js/codemirror/lib/util/xml-hint.js +131 -0
- data/templates/static/js/codemirror/mode/clike/clike.js +300 -0
- data/templates/static/js/codemirror/mode/clike/index.html +103 -0
- data/templates/static/js/codemirror/mode/clike/scala.html +767 -0
- data/templates/static/js/codemirror/mode/clojure/clojure.js +206 -0
- data/templates/static/js/codemirror/mode/clojure/index.html +67 -0
- data/templates/static/js/codemirror/mode/coffeescript/LICENSE +22 -0
- data/templates/static/js/codemirror/mode/coffeescript/coffeescript.js +346 -0
- data/templates/static/js/codemirror/mode/coffeescript/index.html +728 -0
- data/templates/static/js/codemirror/mode/commonlisp/commonlisp.js +101 -0
- data/templates/static/js/codemirror/mode/commonlisp/index.html +165 -0
- data/templates/static/js/codemirror/mode/css/css.js +465 -0
- data/templates/static/js/codemirror/mode/css/index.html +58 -0
- data/templates/static/js/codemirror/mode/css/test.js +501 -0
- data/templates/static/js/codemirror/mode/diff/diff.js +32 -0
- data/templates/static/js/codemirror/mode/diff/index.html +105 -0
- data/templates/static/js/codemirror/mode/ecl/ecl.js +192 -0
- data/templates/static/js/codemirror/mode/ecl/index.html +39 -0
- data/templates/static/js/codemirror/mode/erlang/erlang.js +463 -0
- data/templates/static/js/codemirror/mode/erlang/index.html +64 -0
- data/templates/static/js/codemirror/mode/gfm/gfm.js +94 -0
- data/templates/static/js/codemirror/mode/gfm/index.html +70 -0
- data/templates/static/js/codemirror/mode/gfm/test.js +225 -0
- data/templates/static/js/codemirror/mode/go/go.js +165 -0
- data/templates/static/js/codemirror/mode/go/index.html +74 -0
- data/templates/static/js/codemirror/mode/groovy/groovy.js +210 -0
- data/templates/static/js/codemirror/mode/groovy/index.html +73 -0
- data/templates/static/js/codemirror/mode/haskell/haskell.js +242 -0
- data/templates/static/js/codemirror/mode/haskell/index.html +62 -0
- data/templates/static/js/codemirror/mode/haxe/haxe.js +429 -0
- data/templates/static/js/codemirror/mode/haxe/index.html +90 -0
- data/templates/static/js/codemirror/mode/htmlembedded/htmlembedded.js +73 -0
- data/templates/static/js/codemirror/mode/htmlembedded/index.html +49 -0
- data/templates/static/js/codemirror/mode/htmlmixed/htmlmixed.js +84 -0
- data/templates/static/js/codemirror/mode/htmlmixed/index.html +52 -0
- data/templates/static/js/codemirror/mode/http/http.js +98 -0
- data/templates/static/js/codemirror/mode/http/index.html +32 -0
- data/templates/static/js/codemirror/mode/javascript/index.html +88 -0
- data/templates/static/js/codemirror/mode/javascript/javascript.js +411 -0
- data/templates/static/js/codemirror/mode/javascript/typescript.html +48 -0
- data/templates/static/js/codemirror/mode/jinja2/index.html +38 -0
- data/templates/static/js/codemirror/mode/jinja2/jinja2.js +42 -0
- data/templates/static/js/codemirror/mode/less/index.html +741 -0
- data/templates/static/js/codemirror/mode/less/less.js +266 -0
- data/templates/static/js/codemirror/mode/lua/index.html +74 -0
- data/templates/static/js/codemirror/mode/lua/lua.js +140 -0
- data/templates/static/js/codemirror/mode/markdown/index.html +344 -0
- data/templates/static/js/codemirror/mode/markdown/markdown.js +474 -0
- data/templates/static/js/codemirror/mode/markdown/test.js +1266 -0
- data/templates/static/js/codemirror/mode/mysql/index.html +41 -0
- data/templates/static/js/codemirror/mode/mysql/mysql.js +203 -0
- data/templates/static/js/codemirror/mode/ntriples/index.html +33 -0
- data/templates/static/js/codemirror/mode/ntriples/ntriples.js +170 -0
- data/templates/static/js/codemirror/mode/ocaml/index.html +131 -0
- data/templates/static/js/codemirror/mode/ocaml/ocaml.js +113 -0
- data/templates/static/js/codemirror/mode/pascal/LICENSE +7 -0
- data/templates/static/js/codemirror/mode/pascal/index.html +48 -0
- data/templates/static/js/codemirror/mode/pascal/pascal.js +94 -0
- data/templates/static/js/codemirror/mode/perl/LICENSE +19 -0
- data/templates/static/js/codemirror/mode/perl/index.html +62 -0
- data/templates/static/js/codemirror/mode/perl/perl.js +816 -0
- data/templates/static/js/codemirror/mode/php/index.html +51 -0
- data/templates/static/js/codemirror/mode/php/php.js +129 -0
- data/templates/static/js/codemirror/mode/pig/index.html +42 -0
- data/templates/static/js/codemirror/mode/pig/pig.js +171 -0
- data/templates/static/js/codemirror/mode/plsql/index.html +62 -0
- data/templates/static/js/codemirror/mode/plsql/plsql.js +216 -0
- data/templates/static/js/codemirror/mode/properties/index.html +41 -0
- data/templates/static/js/codemirror/mode/properties/properties.js +63 -0
- data/templates/static/js/codemirror/mode/python/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/python/index.html +124 -0
- data/templates/static/js/codemirror/mode/python/python.js +340 -0
- data/templates/static/js/codemirror/mode/r/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/r/index.html +74 -0
- data/templates/static/js/codemirror/mode/r/r.js +141 -0
- data/templates/static/js/codemirror/mode/rpm/changes/changes.js +19 -0
- data/templates/static/js/codemirror/mode/rpm/changes/index.html +53 -0
- data/templates/static/js/codemirror/mode/rpm/spec/index.html +99 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.css +5 -0
- data/templates/static/js/codemirror/mode/rpm/spec/spec.js +66 -0
- data/templates/static/js/codemirror/mode/rst/index.html +526 -0
- data/templates/static/js/codemirror/mode/rst/rst.js +314 -0
- data/templates/static/js/codemirror/mode/ruby/LICENSE +24 -0
- data/templates/static/js/codemirror/mode/ruby/index.html +173 -0
- data/templates/static/js/codemirror/mode/ruby/ruby.js +195 -0
- data/templates/static/js/codemirror/mode/rust/index.html +48 -0
- data/templates/static/js/codemirror/mode/rust/rust.js +432 -0
- data/templates/static/js/codemirror/mode/scheme/index.html +65 -0
- data/templates/static/js/codemirror/mode/scheme/scheme.js +230 -0
- data/templates/static/js/codemirror/mode/shell/index.html +51 -0
- data/templates/static/js/codemirror/mode/shell/shell.js +118 -0
- data/templates/static/js/codemirror/mode/sieve/LICENSE +23 -0
- data/templates/static/js/codemirror/mode/sieve/index.html +81 -0
- data/templates/static/js/codemirror/mode/sieve/sieve.js +156 -0
- data/templates/static/js/codemirror/mode/smalltalk/index.html +57 -0
- data/templates/static/js/codemirror/mode/smalltalk/smalltalk.js +139 -0
- data/templates/static/js/codemirror/mode/smarty/index.html +83 -0
- data/templates/static/js/codemirror/mode/smarty/smarty.js +148 -0
- data/templates/static/js/codemirror/mode/sparql/index.html +42 -0
- data/templates/static/js/codemirror/mode/sparql/sparql.js +143 -0
- data/templates/static/js/codemirror/mode/stex/index.html +98 -0
- data/templates/static/js/codemirror/mode/stex/stex.js +175 -0
- data/templates/static/js/codemirror/mode/stex/test.js +343 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/index.html +142 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/templates/static/js/codemirror/mode/tiddlywiki/tiddlywiki.js +353 -0
- data/templates/static/js/codemirror/mode/tiki/index.html +81 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.css +26 -0
- data/templates/static/js/codemirror/mode/tiki/tiki.js +309 -0
- data/templates/static/js/codemirror/mode/vb/LICENSE.txt +21 -0
- data/templates/static/js/codemirror/mode/vb/index.html +88 -0
- data/templates/static/js/codemirror/mode/vb/vb.js +260 -0
- data/templates/static/js/codemirror/mode/vbscript/index.html +42 -0
- data/templates/static/js/codemirror/mode/vbscript/vbscript.js +26 -0
- data/templates/static/js/codemirror/mode/velocity/index.html +103 -0
- data/templates/static/js/codemirror/mode/velocity/velocity.js +144 -0
- data/templates/static/js/codemirror/mode/verilog/index.html +210 -0
- data/templates/static/js/codemirror/mode/verilog/verilog.js +182 -0
- data/templates/static/js/codemirror/mode/xml/index.html +45 -0
- data/templates/static/js/codemirror/mode/xml/xml.js +324 -0
- data/templates/static/js/codemirror/mode/xquery/LICENSE +20 -0
- data/templates/static/js/codemirror/mode/xquery/index.html +221 -0
- data/templates/static/js/codemirror/mode/xquery/test.js +77 -0
- data/templates/static/js/codemirror/mode/xquery/xquery.js +450 -0
- data/templates/static/js/codemirror/mode/yaml/index.html +68 -0
- data/templates/static/js/codemirror/mode/yaml/yaml.js +95 -0
- data/templates/static/js/codemirror/mode/z80/index.html +39 -0
- data/templates/static/js/codemirror/mode/z80/z80.js +113 -0
- data/templates/static/js/codemirror/theme/ambiance-mobile.css +6 -0
- data/templates/static/js/codemirror/theme/ambiance.css +76 -0
- data/templates/static/js/codemirror/theme/blackboard.css +25 -0
- data/templates/static/js/codemirror/theme/cobalt.css +18 -0
- data/templates/static/js/codemirror/theme/eclipse.css +25 -0
- data/templates/static/js/codemirror/theme/elegant.css +10 -0
- data/templates/static/js/codemirror/theme/erlang-dark.css +21 -0
- data/templates/static/js/codemirror/theme/lesser-dark.css +44 -0
- data/templates/static/js/codemirror/theme/monokai.css +28 -0
- data/templates/static/js/codemirror/theme/neat.css +9 -0
- data/templates/static/js/codemirror/theme/night.css +21 -0
- data/templates/static/js/codemirror/theme/rubyblue.css +21 -0
- data/templates/static/js/codemirror/theme/solarized.css +207 -0
- data/templates/static/js/codemirror/theme/twilight.css +26 -0
- data/templates/static/js/codemirror/theme/vibrant-ink.css +27 -0
- data/templates/static/js/codemirror/theme/xq-dark.css +46 -0
- data/templates/static/js/d3.v3.min.js +2 -2
- data/templates/static/test/cm.html +33 -0
- data/templates/views/about.slim +15 -0
- data/templates/views/index.slim +1 -1
- data/templates/views/layout.slim +1 -0
- data/templates/views/navbar.slim +4 -4
- 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
|
+
);
|