tui_editor-rails 1.0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +8 -0
- data/.ruby-version +1 -0
- data/Gemfile +6 -0
- data/Gemfile.lock +20 -0
- data/README.md +69 -0
- data/Rakefile +2 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/example/.gitignore +30 -0
- data/example/.ruby-version +1 -0
- data/example/Gemfile +64 -0
- data/example/Gemfile.lock +224 -0
- data/example/README.md +67 -0
- data/example/Rakefile +6 -0
- data/example/app/assets/config/manifest.js +3 -0
- data/example/app/assets/images/.keep +0 -0
- data/example/app/assets/images/screen_capture.png +0 -0
- data/example/app/assets/javascripts/application.js +23 -0
- data/example/app/assets/javascripts/cable.js +13 -0
- data/example/app/assets/javascripts/channels/.keep +0 -0
- data/example/app/assets/javascripts/home.coffee +3 -0
- data/example/app/assets/javascripts/posts.coffee +3 -0
- data/example/app/assets/stylesheets/application.scss +4 -0
- data/example/app/assets/stylesheets/home.scss +3 -0
- data/example/app/assets/stylesheets/posts.scss +3 -0
- data/example/app/assets/stylesheets/scaffolds.scss +84 -0
- data/example/app/channels/application_cable/channel.rb +4 -0
- data/example/app/channels/application_cable/connection.rb +4 -0
- data/example/app/controllers/application_controller.rb +2 -0
- data/example/app/controllers/concerns/.keep +0 -0
- data/example/app/controllers/home_controller.rb +4 -0
- data/example/app/controllers/posts_controller.rb +74 -0
- data/example/app/helpers/application_helper.rb +2 -0
- data/example/app/helpers/home_helper.rb +2 -0
- data/example/app/helpers/posts_helper.rb +2 -0
- data/example/app/jobs/application_job.rb +2 -0
- data/example/app/mailers/application_mailer.rb +4 -0
- data/example/app/models/application_record.rb +3 -0
- data/example/app/models/concerns/.keep +0 -0
- data/example/app/models/post.rb +2 -0
- data/example/app/views/home/index.html.erb +11 -0
- data/example/app/views/layouts/application.html.erb +14 -0
- data/example/app/views/layouts/mailer.html.erb +13 -0
- data/example/app/views/layouts/mailer.text.erb +1 -0
- data/example/app/views/posts/_form.html.erb +27 -0
- data/example/app/views/posts/_post.json.jbuilder +2 -0
- data/example/app/views/posts/edit.html.erb +6 -0
- data/example/app/views/posts/index.html.erb +29 -0
- data/example/app/views/posts/index.json.jbuilder +1 -0
- data/example/app/views/posts/new.html.erb +5 -0
- data/example/app/views/posts/show.html.erb +14 -0
- data/example/app/views/posts/show.json.jbuilder +1 -0
- data/example/bin/bundle +3 -0
- data/example/bin/rails +9 -0
- data/example/bin/rake +9 -0
- data/example/bin/setup +36 -0
- data/example/bin/spring +17 -0
- data/example/bin/update +31 -0
- data/example/bin/yarn +11 -0
- data/example/config.ru +5 -0
- data/example/config/application.rb +19 -0
- data/example/config/boot.rb +4 -0
- data/example/config/cable.yml +10 -0
- data/example/config/credentials.yml.enc +1 -0
- data/example/config/database.yml +25 -0
- data/example/config/environment.rb +5 -0
- data/example/config/environments/development.rb +61 -0
- data/example/config/environments/production.rb +94 -0
- data/example/config/environments/test.rb +46 -0
- data/example/config/initializers/application_controller_renderer.rb +8 -0
- data/example/config/initializers/assets.rb +14 -0
- data/example/config/initializers/backtrace_silencers.rb +7 -0
- data/example/config/initializers/content_security_policy.rb +22 -0
- data/example/config/initializers/cookies_serializer.rb +5 -0
- data/example/config/initializers/filter_parameter_logging.rb +4 -0
- data/example/config/initializers/inflections.rb +16 -0
- data/example/config/initializers/mime_types.rb +4 -0
- data/example/config/initializers/wrap_parameters.rb +14 -0
- data/example/config/locales/en.yml +33 -0
- data/example/config/puma.rb +34 -0
- data/example/config/routes.rb +6 -0
- data/example/config/spring.rb +6 -0
- data/example/config/storage.yml +35 -0
- data/example/db/migrate/20180208210404_create_posts.rb +10 -0
- data/example/db/schema.rb +22 -0
- data/example/db/seeds.rb +7 -0
- data/example/lib/assets/.keep +0 -0
- data/example/lib/tasks/.keep +0 -0
- data/example/log/.keep +0 -0
- data/example/package.json +5 -0
- data/example/public/404.html +67 -0
- data/example/public/422.html +67 -0
- data/example/public/500.html +66 -0
- data/example/public/apple-touch-icon-precomposed.png +0 -0
- data/example/public/apple-touch-icon.png +0 -0
- data/example/public/favicon.ico +0 -0
- data/example/public/robots.txt +1 -0
- data/example/test/application_system_test_case.rb +5 -0
- data/example/test/controllers/.keep +0 -0
- data/example/test/controllers/home_controller_test.rb +9 -0
- data/example/test/controllers/posts_controller_test.rb +48 -0
- data/example/test/fixtures/.keep +0 -0
- data/example/test/fixtures/files/.keep +0 -0
- data/example/test/fixtures/posts.yml +9 -0
- data/example/test/helpers/.keep +0 -0
- data/example/test/integration/.keep +0 -0
- data/example/test/mailers/.keep +0 -0
- data/example/test/models/.keep +0 -0
- data/example/test/models/post_test.rb +7 -0
- data/example/test/system/.keep +0 -0
- data/example/test/system/posts_test.rb +45 -0
- data/example/test/test_helper.rb +10 -0
- data/example/tmp/.keep +0 -0
- data/example/vendor/.keep +0 -0
- data/lib/tui_editor/rails.rb +8 -0
- data/lib/tui_editor/rails/version.rb +5 -0
- data/tui_editor-rails.gemspec +34 -0
- data/vendor/assets/components/codemirror/.bower.json +31 -0
- data/vendor/assets/components/codemirror/AUTHORS +714 -0
- data/vendor/assets/components/codemirror/CHANGELOG.md +1316 -0
- data/vendor/assets/components/codemirror/CONTRIBUTING.md +92 -0
- data/vendor/assets/components/codemirror/LICENSE +21 -0
- data/vendor/assets/components/codemirror/README.md +35 -0
- data/vendor/assets/components/codemirror/addon/comment/comment.js +209 -0
- data/vendor/assets/components/codemirror/addon/comment/continuecomment.js +78 -0
- data/vendor/assets/components/codemirror/addon/dialog/dialog.css +32 -0
- data/vendor/assets/components/codemirror/addon/dialog/dialog.js +157 -0
- data/vendor/assets/components/codemirror/addon/display/autorefresh.js +47 -0
- data/vendor/assets/components/codemirror/addon/display/fullscreen.css +6 -0
- data/vendor/assets/components/codemirror/addon/display/fullscreen.js +41 -0
- data/vendor/assets/components/codemirror/addon/display/panel.js +123 -0
- data/vendor/assets/components/codemirror/addon/display/placeholder.js +63 -0
- data/vendor/assets/components/codemirror/addon/display/rulers.js +51 -0
- data/vendor/assets/components/codemirror/addon/edit/closebrackets.js +194 -0
- data/vendor/assets/components/codemirror/addon/edit/closetag.js +175 -0
- data/vendor/assets/components/codemirror/addon/edit/continuelist.js +89 -0
- data/vendor/assets/components/codemirror/addon/edit/matchbrackets.js +145 -0
- data/vendor/assets/components/codemirror/addon/edit/matchtags.js +66 -0
- data/vendor/assets/components/codemirror/addon/edit/trailingspace.js +27 -0
- data/vendor/assets/components/codemirror/addon/fold/brace-fold.js +105 -0
- data/vendor/assets/components/codemirror/addon/fold/comment-fold.js +59 -0
- data/vendor/assets/components/codemirror/addon/fold/foldcode.js +152 -0
- data/vendor/assets/components/codemirror/addon/fold/foldgutter.css +20 -0
- data/vendor/assets/components/codemirror/addon/fold/foldgutter.js +146 -0
- data/vendor/assets/components/codemirror/addon/fold/indent-fold.js +48 -0
- data/vendor/assets/components/codemirror/addon/fold/markdown-fold.js +49 -0
- data/vendor/assets/components/codemirror/addon/fold/xml-fold.js +182 -0
- data/vendor/assets/components/codemirror/addon/hint/anyword-hint.js +41 -0
- data/vendor/assets/components/codemirror/addon/hint/css-hint.js +60 -0
- data/vendor/assets/components/codemirror/addon/hint/html-hint.js +348 -0
- data/vendor/assets/components/codemirror/addon/hint/javascript-hint.js +155 -0
- data/vendor/assets/components/codemirror/addon/hint/show-hint.css +36 -0
- data/vendor/assets/components/codemirror/addon/hint/show-hint.js +432 -0
- data/vendor/assets/components/codemirror/addon/hint/sql-hint.js +286 -0
- data/vendor/assets/components/codemirror/addon/hint/xml-hint.js +110 -0
- data/vendor/assets/components/codemirror/addon/lint/coffeescript-lint.js +47 -0
- data/vendor/assets/components/codemirror/addon/lint/css-lint.js +40 -0
- data/vendor/assets/components/codemirror/addon/lint/html-lint.js +53 -0
- data/vendor/assets/components/codemirror/addon/lint/javascript-lint.js +63 -0
- data/vendor/assets/components/codemirror/addon/lint/json-lint.js +37 -0
- data/vendor/assets/components/codemirror/addon/lint/lint.css +73 -0
- data/vendor/assets/components/codemirror/addon/lint/lint.js +252 -0
- data/vendor/assets/components/codemirror/addon/lint/yaml-lint.js +41 -0
- data/vendor/assets/components/codemirror/addon/merge/merge.css +113 -0
- data/vendor/assets/components/codemirror/addon/merge/merge.js +1001 -0
- data/vendor/assets/components/codemirror/addon/mode/loadmode.js +64 -0
- data/vendor/assets/components/codemirror/addon/mode/multiplex.js +123 -0
- data/vendor/assets/components/codemirror/addon/mode/multiplex_test.js +33 -0
- data/vendor/assets/components/codemirror/addon/mode/overlay.js +90 -0
- data/vendor/assets/components/codemirror/addon/mode/simple.js +216 -0
- data/vendor/assets/components/codemirror/addon/runmode/colorize.js +40 -0
- data/vendor/assets/components/codemirror/addon/runmode/runmode-standalone.js +158 -0
- data/vendor/assets/components/codemirror/addon/runmode/runmode.js +72 -0
- data/vendor/assets/components/codemirror/addon/runmode/runmode.node.js +197 -0
- data/vendor/assets/components/codemirror/addon/scroll/annotatescrollbar.js +122 -0
- data/vendor/assets/components/codemirror/addon/scroll/scrollpastend.js +48 -0
- data/vendor/assets/components/codemirror/addon/scroll/simplescrollbars.css +66 -0
- data/vendor/assets/components/codemirror/addon/scroll/simplescrollbars.js +152 -0
- data/vendor/assets/components/codemirror/addon/search/jump-to-line.js +49 -0
- data/vendor/assets/components/codemirror/addon/search/match-highlighter.js +165 -0
- data/vendor/assets/components/codemirror/addon/search/matchesonscrollbar.css +8 -0
- data/vendor/assets/components/codemirror/addon/search/matchesonscrollbar.js +97 -0
- data/vendor/assets/components/codemirror/addon/search/search.js +252 -0
- data/vendor/assets/components/codemirror/addon/search/searchcursor.js +289 -0
- data/vendor/assets/components/codemirror/addon/selection/active-line.js +72 -0
- data/vendor/assets/components/codemirror/addon/selection/mark-selection.js +119 -0
- data/vendor/assets/components/codemirror/addon/selection/selection-pointer.js +98 -0
- data/vendor/assets/components/codemirror/addon/tern/tern.css +87 -0
- data/vendor/assets/components/codemirror/addon/tern/tern.js +718 -0
- data/vendor/assets/components/codemirror/addon/tern/worker.js +44 -0
- data/vendor/assets/components/codemirror/addon/wrap/hardwrap.js +144 -0
- data/vendor/assets/components/codemirror/bower.json +17 -0
- data/vendor/assets/components/codemirror/component-tools/bower.json +17 -0
- data/vendor/assets/components/codemirror/component-tools/build.sh +31 -0
- data/vendor/assets/components/codemirror/component-tools/update.py +38 -0
- data/vendor/assets/components/codemirror/keymap/emacs.js +416 -0
- data/vendor/assets/components/codemirror/keymap/sublime.js +685 -0
- data/vendor/assets/components/codemirror/keymap/vim.js +5219 -0
- data/vendor/assets/components/codemirror/lib/codemirror.css +346 -0
- data/vendor/assets/components/codemirror/lib/codemirror.js +9669 -0
- data/vendor/assets/components/codemirror/mode/apl/apl.js +174 -0
- data/vendor/assets/components/codemirror/mode/asciiarmor/asciiarmor.js +74 -0
- data/vendor/assets/components/codemirror/mode/asn.1/asn.1.js +204 -0
- data/vendor/assets/components/codemirror/mode/asterisk/asterisk.js +196 -0
- data/vendor/assets/components/codemirror/mode/brainfuck/brainfuck.js +85 -0
- data/vendor/assets/components/codemirror/mode/clike/clike.js +817 -0
- data/vendor/assets/components/codemirror/mode/clojure/clojure.js +306 -0
- data/vendor/assets/components/codemirror/mode/cmake/cmake.js +97 -0
- data/vendor/assets/components/codemirror/mode/cobol/cobol.js +255 -0
- data/vendor/assets/components/codemirror/mode/coffeescript/coffeescript.js +359 -0
- data/vendor/assets/components/codemirror/mode/commonlisp/commonlisp.js +124 -0
- data/vendor/assets/components/codemirror/mode/crystal/crystal.js +433 -0
- data/vendor/assets/components/codemirror/mode/css/css.js +832 -0
- data/vendor/assets/components/codemirror/mode/cypher/cypher.js +150 -0
- data/vendor/assets/components/codemirror/mode/d/d.js +218 -0
- data/vendor/assets/components/codemirror/mode/dart/dart.js +157 -0
- data/vendor/assets/components/codemirror/mode/diff/diff.js +47 -0
- data/vendor/assets/components/codemirror/mode/django/django.js +356 -0
- data/vendor/assets/components/codemirror/mode/dockerfile/dockerfile.js +79 -0
- data/vendor/assets/components/codemirror/mode/dtd/dtd.js +142 -0
- data/vendor/assets/components/codemirror/mode/dylan/dylan.js +352 -0
- data/vendor/assets/components/codemirror/mode/ebnf/ebnf.js +195 -0
- data/vendor/assets/components/codemirror/mode/ecl/ecl.js +206 -0
- data/vendor/assets/components/codemirror/mode/eiffel/eiffel.js +160 -0
- data/vendor/assets/components/codemirror/mode/elm/elm.js +205 -0
- data/vendor/assets/components/codemirror/mode/erlang/erlang.js +619 -0
- data/vendor/assets/components/codemirror/mode/factor/factor.js +85 -0
- data/vendor/assets/components/codemirror/mode/fcl/fcl.js +173 -0
- data/vendor/assets/components/codemirror/mode/forth/forth.js +180 -0
- data/vendor/assets/components/codemirror/mode/fortran/fortran.js +188 -0
- data/vendor/assets/components/codemirror/mode/gas/gas.js +345 -0
- data/vendor/assets/components/codemirror/mode/gfm/gfm.js +129 -0
- data/vendor/assets/components/codemirror/mode/gherkin/gherkin.js +178 -0
- data/vendor/assets/components/codemirror/mode/go/go.js +187 -0
- data/vendor/assets/components/codemirror/mode/groovy/groovy.js +230 -0
- data/vendor/assets/components/codemirror/mode/haml/haml.js +161 -0
- data/vendor/assets/components/codemirror/mode/handlebars/handlebars.js +62 -0
- data/vendor/assets/components/codemirror/mode/haskell-literate/haskell-literate.js +43 -0
- data/vendor/assets/components/codemirror/mode/haskell/haskell.js +267 -0
- data/vendor/assets/components/codemirror/mode/haxe/haxe.js +515 -0
- data/vendor/assets/components/codemirror/mode/htmlembedded/htmlembedded.js +37 -0
- data/vendor/assets/components/codemirror/mode/htmlmixed/htmlmixed.js +152 -0
- data/vendor/assets/components/codemirror/mode/http/http.js +113 -0
- data/vendor/assets/components/codemirror/mode/idl/idl.js +290 -0
- data/vendor/assets/components/codemirror/mode/javascript/javascript.js +865 -0
- data/vendor/assets/components/codemirror/mode/jinja2/jinja2.js +142 -0
- data/vendor/assets/components/codemirror/mode/jsx/jsx.js +148 -0
- data/vendor/assets/components/codemirror/mode/julia/julia.js +418 -0
- data/vendor/assets/components/codemirror/mode/livescript/livescript.js +280 -0
- data/vendor/assets/components/codemirror/mode/lua/lua.js +159 -0
- data/vendor/assets/components/codemirror/mode/markdown/markdown.js +872 -0
- data/vendor/assets/components/codemirror/mode/mathematica/mathematica.js +176 -0
- data/vendor/assets/components/codemirror/mode/mbox/mbox.js +129 -0
- data/vendor/assets/components/codemirror/mode/meta.js +217 -0
- data/vendor/assets/components/codemirror/mode/mirc/mirc.js +193 -0
- data/vendor/assets/components/codemirror/mode/mllike/mllike.js +356 -0
- data/vendor/assets/components/codemirror/mode/modelica/modelica.js +245 -0
- data/vendor/assets/components/codemirror/mode/mscgen/mscgen.js +175 -0
- data/vendor/assets/components/codemirror/mode/mumps/mumps.js +148 -0
- data/vendor/assets/components/codemirror/mode/nginx/nginx.js +178 -0
- data/vendor/assets/components/codemirror/mode/nsis/nsis.js +95 -0
- data/vendor/assets/components/codemirror/mode/ntriples/ntriples.js +195 -0
- data/vendor/assets/components/codemirror/mode/octave/octave.js +139 -0
- data/vendor/assets/components/codemirror/mode/oz/oz.js +252 -0
- data/vendor/assets/components/codemirror/mode/pascal/pascal.js +109 -0
- data/vendor/assets/components/codemirror/mode/pegjs/pegjs.js +114 -0
- data/vendor/assets/components/codemirror/mode/perl/perl.js +837 -0
- data/vendor/assets/components/codemirror/mode/php/php.js +234 -0
- data/vendor/assets/components/codemirror/mode/pig/pig.js +178 -0
- data/vendor/assets/components/codemirror/mode/powershell/powershell.js +398 -0
- data/vendor/assets/components/codemirror/mode/properties/properties.js +78 -0
- data/vendor/assets/components/codemirror/mode/protobuf/protobuf.js +69 -0
- data/vendor/assets/components/codemirror/mode/pug/pug.js +591 -0
- data/vendor/assets/components/codemirror/mode/puppet/puppet.js +220 -0
- data/vendor/assets/components/codemirror/mode/python/python.js +334 -0
- data/vendor/assets/components/codemirror/mode/q/q.js +139 -0
- data/vendor/assets/components/codemirror/mode/r/r.js +183 -0
- data/vendor/assets/components/codemirror/mode/rpm/rpm.js +109 -0
- data/vendor/assets/components/codemirror/mode/rst/rst.js +557 -0
- data/vendor/assets/components/codemirror/mode/ruby/ruby.js +296 -0
- data/vendor/assets/components/codemirror/mode/rust/rust.js +72 -0
- data/vendor/assets/components/codemirror/mode/sas/sas.js +303 -0
- data/vendor/assets/components/codemirror/mode/sass/sass.js +454 -0
- data/vendor/assets/components/codemirror/mode/scheme/scheme.js +249 -0
- data/vendor/assets/components/codemirror/mode/shell/shell.js +151 -0
- data/vendor/assets/components/codemirror/mode/sieve/sieve.js +193 -0
- data/vendor/assets/components/codemirror/mode/slim/slim.js +575 -0
- data/vendor/assets/components/codemirror/mode/smalltalk/smalltalk.js +168 -0
- data/vendor/assets/components/codemirror/mode/smarty/smarty.js +225 -0
- data/vendor/assets/components/codemirror/mode/solr/solr.js +104 -0
- data/vendor/assets/components/codemirror/mode/soy/soy.js +354 -0
- data/vendor/assets/components/codemirror/mode/sparql/sparql.js +180 -0
- data/vendor/assets/components/codemirror/mode/spreadsheet/spreadsheet.js +112 -0
- data/vendor/assets/components/codemirror/mode/sql/sql.js +488 -0
- data/vendor/assets/components/codemirror/mode/stex/stex.js +251 -0
- data/vendor/assets/components/codemirror/mode/stylus/stylus.js +771 -0
- data/vendor/assets/components/codemirror/mode/swift/swift.js +219 -0
- data/vendor/assets/components/codemirror/mode/tcl/tcl.js +139 -0
- data/vendor/assets/components/codemirror/mode/textile/textile.js +469 -0
- data/vendor/assets/components/codemirror/mode/tiddlywiki/tiddlywiki.css +14 -0
- data/vendor/assets/components/codemirror/mode/tiddlywiki/tiddlywiki.js +308 -0
- data/vendor/assets/components/codemirror/mode/tiki/tiki.css +26 -0
- data/vendor/assets/components/codemirror/mode/tiki/tiki.js +312 -0
- data/vendor/assets/components/codemirror/mode/toml/toml.js +88 -0
- data/vendor/assets/components/codemirror/mode/tornado/tornado.js +68 -0
- data/vendor/assets/components/codemirror/mode/troff/troff.js +84 -0
- data/vendor/assets/components/codemirror/mode/ttcn-cfg/ttcn-cfg.js +214 -0
- data/vendor/assets/components/codemirror/mode/ttcn/ttcn.js +283 -0
- data/vendor/assets/components/codemirror/mode/turtle/turtle.js +162 -0
- data/vendor/assets/components/codemirror/mode/twig/twig.js +141 -0
- data/vendor/assets/components/codemirror/mode/vb/vb.js +275 -0
- data/vendor/assets/components/codemirror/mode/vbscript/vbscript.js +350 -0
- data/vendor/assets/components/codemirror/mode/velocity/velocity.js +201 -0
- data/vendor/assets/components/codemirror/mode/verilog/verilog.js +675 -0
- data/vendor/assets/components/codemirror/mode/vhdl/vhdl.js +189 -0
- data/vendor/assets/components/codemirror/mode/vue/vue.js +77 -0
- data/vendor/assets/components/codemirror/mode/webidl/webidl.js +195 -0
- data/vendor/assets/components/codemirror/mode/xml/xml.js +401 -0
- data/vendor/assets/components/codemirror/mode/xquery/xquery.js +448 -0
- data/vendor/assets/components/codemirror/mode/yacas/yacas.js +204 -0
- data/vendor/assets/components/codemirror/mode/yaml-frontmatter/yaml-frontmatter.js +68 -0
- data/vendor/assets/components/codemirror/mode/yaml/yaml.js +118 -0
- data/vendor/assets/components/codemirror/mode/z80/z80.js +116 -0
- data/vendor/assets/components/codemirror/rollup.config.js +18 -0
- data/vendor/assets/components/codemirror/src/codemirror.js +3 -0
- data/vendor/assets/components/codemirror/src/display/Display.js +106 -0
- data/vendor/assets/components/codemirror/src/display/focus.js +47 -0
- data/vendor/assets/components/codemirror/src/display/gutters.js +34 -0
- data/vendor/assets/components/codemirror/src/display/highlight_worker.js +55 -0
- data/vendor/assets/components/codemirror/src/display/line_numbers.js +48 -0
- data/vendor/assets/components/codemirror/src/display/mode_state.js +22 -0
- data/vendor/assets/components/codemirror/src/display/operations.js +205 -0
- data/vendor/assets/components/codemirror/src/display/scroll_events.js +115 -0
- data/vendor/assets/components/codemirror/src/display/scrollbars.js +192 -0
- data/vendor/assets/components/codemirror/src/display/scrolling.js +184 -0
- data/vendor/assets/components/codemirror/src/display/selection.js +158 -0
- data/vendor/assets/components/codemirror/src/display/update_display.js +260 -0
- data/vendor/assets/components/codemirror/src/display/update_line.js +188 -0
- data/vendor/assets/components/codemirror/src/display/update_lines.js +64 -0
- data/vendor/assets/components/codemirror/src/display/view_tracking.js +153 -0
- data/vendor/assets/components/codemirror/src/edit/CodeMirror.js +214 -0
- data/vendor/assets/components/codemirror/src/edit/commands.js +178 -0
- data/vendor/assets/components/codemirror/src/edit/deleteNearSelection.js +30 -0
- data/vendor/assets/components/codemirror/src/edit/drop_events.js +119 -0
- data/vendor/assets/components/codemirror/src/edit/fromTextArea.js +61 -0
- data/vendor/assets/components/codemirror/src/edit/global_events.js +44 -0
- data/vendor/assets/components/codemirror/src/edit/key_events.js +159 -0
- data/vendor/assets/components/codemirror/src/edit/legacy.js +62 -0
- data/vendor/assets/components/codemirror/src/edit/main.js +69 -0
- data/vendor/assets/components/codemirror/src/edit/methods.js +539 -0
- data/vendor/assets/components/codemirror/src/edit/mouse_events.js +407 -0
- data/vendor/assets/components/codemirror/src/edit/options.js +191 -0
- data/vendor/assets/components/codemirror/src/edit/utils.js +7 -0
- data/vendor/assets/components/codemirror/src/input/ContentEditableInput.js +517 -0
- data/vendor/assets/components/codemirror/src/input/TextareaInput.js +350 -0
- data/vendor/assets/components/codemirror/src/input/indent.js +71 -0
- data/vendor/assets/components/codemirror/src/input/input.js +135 -0
- data/vendor/assets/components/codemirror/src/input/keymap.js +148 -0
- data/vendor/assets/components/codemirror/src/input/keynames.js +17 -0
- data/vendor/assets/components/codemirror/src/input/movement.js +110 -0
- data/vendor/assets/components/codemirror/src/line/highlight.js +284 -0
- data/vendor/assets/components/codemirror/src/line/line_data.js +337 -0
- data/vendor/assets/components/codemirror/src/line/pos.js +40 -0
- data/vendor/assets/components/codemirror/src/line/saw_special_spans.js +10 -0
- data/vendor/assets/components/codemirror/src/line/spans.js +372 -0
- data/vendor/assets/components/codemirror/src/line/utils_line.js +85 -0
- data/vendor/assets/components/codemirror/src/measurement/position_measurement.js +700 -0
- data/vendor/assets/components/codemirror/src/measurement/widgets.js +26 -0
- data/vendor/assets/components/codemirror/src/model/Doc.js +432 -0
- data/vendor/assets/components/codemirror/src/model/change_measurement.js +61 -0
- data/vendor/assets/components/codemirror/src/model/changes.js +330 -0
- data/vendor/assets/components/codemirror/src/model/chunk.js +167 -0
- data/vendor/assets/components/codemirror/src/model/document_data.js +111 -0
- data/vendor/assets/components/codemirror/src/model/history.js +228 -0
- data/vendor/assets/components/codemirror/src/model/line_widget.js +78 -0
- data/vendor/assets/components/codemirror/src/model/mark_text.js +292 -0
- data/vendor/assets/components/codemirror/src/model/selection.js +82 -0
- data/vendor/assets/components/codemirror/src/model/selection_updates.js +208 -0
- data/vendor/assets/components/codemirror/src/modes.js +96 -0
- data/vendor/assets/components/codemirror/src/util/StringStream.js +90 -0
- data/vendor/assets/components/codemirror/src/util/bidi.js +214 -0
- data/vendor/assets/components/codemirror/src/util/browser.js +33 -0
- data/vendor/assets/components/codemirror/src/util/dom.js +97 -0
- data/vendor/assets/components/codemirror/src/util/event.js +103 -0
- data/vendor/assets/components/codemirror/src/util/feature_detection.js +84 -0
- data/vendor/assets/components/codemirror/src/util/misc.js +150 -0
- data/vendor/assets/components/codemirror/src/util/operation_group.js +72 -0
- data/vendor/assets/components/codemirror/theme/3024-day.css +41 -0
- data/vendor/assets/components/codemirror/theme/3024-night.css +39 -0
- data/vendor/assets/components/codemirror/theme/abcdef.css +32 -0
- data/vendor/assets/components/codemirror/theme/ambiance-mobile.css +5 -0
- data/vendor/assets/components/codemirror/theme/ambiance.css +74 -0
- data/vendor/assets/components/codemirror/theme/base16-dark.css +38 -0
- data/vendor/assets/components/codemirror/theme/base16-light.css +38 -0
- data/vendor/assets/components/codemirror/theme/bespin.css +34 -0
- data/vendor/assets/components/codemirror/theme/blackboard.css +32 -0
- data/vendor/assets/components/codemirror/theme/cobalt.css +25 -0
- data/vendor/assets/components/codemirror/theme/colorforth.css +33 -0
- data/vendor/assets/components/codemirror/theme/dracula.css +40 -0
- data/vendor/assets/components/codemirror/theme/duotone-dark.css +35 -0
- data/vendor/assets/components/codemirror/theme/duotone-light.css +36 -0
- data/vendor/assets/components/codemirror/theme/eclipse.css +23 -0
- data/vendor/assets/components/codemirror/theme/elegant.css +13 -0
- data/vendor/assets/components/codemirror/theme/erlang-dark.css +34 -0
- data/vendor/assets/components/codemirror/theme/hopscotch.css +34 -0
- data/vendor/assets/components/codemirror/theme/icecoder.css +43 -0
- data/vendor/assets/components/codemirror/theme/isotope.css +34 -0
- data/vendor/assets/components/codemirror/theme/lesser-dark.css +47 -0
- data/vendor/assets/components/codemirror/theme/liquibyte.css +95 -0
- data/vendor/assets/components/codemirror/theme/material.css +53 -0
- data/vendor/assets/components/codemirror/theme/mbo.css +37 -0
- data/vendor/assets/components/codemirror/theme/mdn-like.css +46 -0
- data/vendor/assets/components/codemirror/theme/midnight.css +43 -0
- data/vendor/assets/components/codemirror/theme/monokai.css +36 -0
- data/vendor/assets/components/codemirror/theme/neat.css +12 -0
- data/vendor/assets/components/codemirror/theme/neo.css +43 -0
- data/vendor/assets/components/codemirror/theme/night.css +27 -0
- data/vendor/assets/components/codemirror/theme/oceanic-next.css +44 -0
- data/vendor/assets/components/codemirror/theme/panda-syntax.css +85 -0
- data/vendor/assets/components/codemirror/theme/paraiso-dark.css +38 -0
- data/vendor/assets/components/codemirror/theme/paraiso-light.css +38 -0
- data/vendor/assets/components/codemirror/theme/pastel-on-dark.css +52 -0
- data/vendor/assets/components/codemirror/theme/railscasts.css +34 -0
- data/vendor/assets/components/codemirror/theme/rubyblue.css +25 -0
- data/vendor/assets/components/codemirror/theme/seti.css +44 -0
- data/vendor/assets/components/codemirror/theme/shadowfox.css +52 -0
- data/vendor/assets/components/codemirror/theme/solarized.css +168 -0
- data/vendor/assets/components/codemirror/theme/the-matrix.css +30 -0
- data/vendor/assets/components/codemirror/theme/tomorrow-night-bright.css +35 -0
- data/vendor/assets/components/codemirror/theme/tomorrow-night-eighties.css +38 -0
- data/vendor/assets/components/codemirror/theme/ttcn.css +64 -0
- data/vendor/assets/components/codemirror/theme/twilight.css +32 -0
- data/vendor/assets/components/codemirror/theme/vibrant-ink.css +34 -0
- data/vendor/assets/components/codemirror/theme/xq-dark.css +53 -0
- data/vendor/assets/components/codemirror/theme/xq-light.css +43 -0
- data/vendor/assets/components/codemirror/theme/yeti.css +44 -0
- data/vendor/assets/components/codemirror/theme/zenburn.css +37 -0
- data/vendor/assets/components/eve/.bower.json +12 -0
- data/vendor/assets/components/eve/LICENSE +202 -0
- data/vendor/assets/components/eve/README.md +7 -0
- data/vendor/assets/components/eve/component.json +13 -0
- data/vendor/assets/components/eve/e.html +66 -0
- data/vendor/assets/components/eve/eve.js +371 -0
- data/vendor/assets/components/eve/package.json +18 -0
- data/vendor/assets/components/highlightjs/.bower.json +24 -0
- data/vendor/assets/components/highlightjs/LICENSE +24 -0
- data/vendor/assets/components/highlightjs/Makefile +21 -0
- data/vendor/assets/components/highlightjs/README.md +12 -0
- data/vendor/assets/components/highlightjs/bower.json +14 -0
- data/vendor/assets/components/highlightjs/component.json +12 -0
- data/vendor/assets/components/highlightjs/composer.json +26 -0
- data/vendor/assets/components/highlightjs/highlight.pack.js +16645 -0
- data/vendor/assets/components/highlightjs/highlight.pack.min.js +15 -0
- data/vendor/assets/components/highlightjs/package.json +8 -0
- data/vendor/assets/components/highlightjs/styles/agate.css +108 -0
- data/vendor/assets/components/highlightjs/styles/androidstudio.css +66 -0
- data/vendor/assets/components/highlightjs/styles/arduino-light.css +88 -0
- data/vendor/assets/components/highlightjs/styles/arta.css +73 -0
- data/vendor/assets/components/highlightjs/styles/ascetic.css +45 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave-dark.css +83 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave-light.css +85 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-cave.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-dune.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-estuary.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-forest.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-heath.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-lakeside.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-plateau.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna.dark.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-savanna.light.css +113 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-seaside.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool-dark.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool-light.css +69 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool.dark.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atelier-sulphurpool.light.css +94 -0
- data/vendor/assets/components/highlightjs/styles/atom-one-dark.css +96 -0
- data/vendor/assets/components/highlightjs/styles/atom-one-light.css +96 -0
- data/vendor/assets/components/highlightjs/styles/brown-paper.css +64 -0
- data/vendor/assets/components/highlightjs/styles/brown-papersq.png +0 -0
- data/vendor/assets/components/highlightjs/styles/brown_paper.css +103 -0
- data/vendor/assets/components/highlightjs/styles/brown_papersq.png +0 -0
- data/vendor/assets/components/highlightjs/styles/codepen-embed.css +60 -0
- data/vendor/assets/components/highlightjs/styles/color-brewer.css +71 -0
- data/vendor/assets/components/highlightjs/styles/darcula.css +77 -0
- data/vendor/assets/components/highlightjs/styles/dark.css +63 -0
- data/vendor/assets/components/highlightjs/styles/darkula.css +6 -0
- data/vendor/assets/components/highlightjs/styles/default.css +99 -0
- data/vendor/assets/components/highlightjs/styles/docco.css +97 -0
- data/vendor/assets/components/highlightjs/styles/dracula.css +76 -0
- data/vendor/assets/components/highlightjs/styles/far.css +71 -0
- data/vendor/assets/components/highlightjs/styles/foundation.css +88 -0
- data/vendor/assets/components/highlightjs/styles/github-gist.css +71 -0
- data/vendor/assets/components/highlightjs/styles/github.css +99 -0
- data/vendor/assets/components/highlightjs/styles/googlecode.css +89 -0
- data/vendor/assets/components/highlightjs/styles/grayscale.css +101 -0
- data/vendor/assets/components/highlightjs/styles/gruvbox-dark.css +108 -0
- data/vendor/assets/components/highlightjs/styles/gruvbox-light.css +108 -0
- data/vendor/assets/components/highlightjs/styles/hopscotch.css +83 -0
- data/vendor/assets/components/highlightjs/styles/hybrid.css +102 -0
- data/vendor/assets/components/highlightjs/styles/idea.css +97 -0
- data/vendor/assets/components/highlightjs/styles/ir-black.css +73 -0
- data/vendor/assets/components/highlightjs/styles/ir_black.css +106 -0
- data/vendor/assets/components/highlightjs/styles/kimbie.dark.css +74 -0
- data/vendor/assets/components/highlightjs/styles/kimbie.light.css +74 -0
- data/vendor/assets/components/highlightjs/styles/magula.css +70 -0
- data/vendor/assets/components/highlightjs/styles/mono-blue.css +59 -0
- data/vendor/assets/components/highlightjs/styles/monokai-sublime.css +83 -0
- data/vendor/assets/components/highlightjs/styles/monokai.css +70 -0
- data/vendor/assets/components/highlightjs/styles/monokai_sublime.css +154 -0
- data/vendor/assets/components/highlightjs/styles/obsidian.css +88 -0
- data/vendor/assets/components/highlightjs/styles/ocean.css +74 -0
- data/vendor/assets/components/highlightjs/styles/paraiso-dark.css +72 -0
- data/vendor/assets/components/highlightjs/styles/paraiso-light.css +72 -0
- data/vendor/assets/components/highlightjs/styles/paraiso.dark.css +96 -0
- data/vendor/assets/components/highlightjs/styles/paraiso.light.css +96 -0
- data/vendor/assets/components/highlightjs/styles/pojoaque.css +83 -0
- data/vendor/assets/components/highlightjs/styles/pojoaque.jpg +0 -0
- data/vendor/assets/components/highlightjs/styles/purebasic.css +96 -0
- data/vendor/assets/components/highlightjs/styles/qtcreator_dark.css +83 -0
- data/vendor/assets/components/highlightjs/styles/qtcreator_light.css +83 -0
- data/vendor/assets/components/highlightjs/styles/railscasts.css +106 -0
- data/vendor/assets/components/highlightjs/styles/rainbow.css +85 -0
- data/vendor/assets/components/highlightjs/styles/routeros.css +108 -0
- data/vendor/assets/components/highlightjs/styles/school-book.css +72 -0
- data/vendor/assets/components/highlightjs/styles/school-book.png +0 -0
- data/vendor/assets/components/highlightjs/styles/school_book.css +111 -0
- data/vendor/assets/components/highlightjs/styles/school_book.png +0 -0
- data/vendor/assets/components/highlightjs/styles/solarized-dark.css +84 -0
- data/vendor/assets/components/highlightjs/styles/solarized-light.css +84 -0
- data/vendor/assets/components/highlightjs/styles/solarized_dark.css +107 -0
- data/vendor/assets/components/highlightjs/styles/solarized_light.css +107 -0
- data/vendor/assets/components/highlightjs/styles/sunburst.css +102 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night-blue.css +75 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night-bright.css +74 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night-eighties.css +74 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow-night.css +75 -0
- data/vendor/assets/components/highlightjs/styles/tomorrow.css +72 -0
- data/vendor/assets/components/highlightjs/styles/vs.css +68 -0
- data/vendor/assets/components/highlightjs/styles/vs2015.css +115 -0
- data/vendor/assets/components/highlightjs/styles/xcode.css +93 -0
- data/vendor/assets/components/highlightjs/styles/xt256.css +92 -0
- data/vendor/assets/components/highlightjs/styles/zenburn.css +80 -0
- data/vendor/assets/components/jquery/.bower.json +25 -0
- data/vendor/assets/components/jquery/AUTHORS.txt +313 -0
- data/vendor/assets/components/jquery/LICENSE.txt +36 -0
- data/vendor/assets/components/jquery/README.md +67 -0
- data/vendor/assets/components/jquery/bower.json +14 -0
- data/vendor/assets/components/jquery/dist/core.js +399 -0
- data/vendor/assets/components/jquery/dist/jquery.js +10364 -0
- data/vendor/assets/components/jquery/dist/jquery.min.js +2 -0
- data/vendor/assets/components/jquery/dist/jquery.min.map +1 -0
- data/vendor/assets/components/jquery/dist/jquery.slim.js +8269 -0
- data/vendor/assets/components/jquery/dist/jquery.slim.min.js +2 -0
- data/vendor/assets/components/jquery/dist/jquery.slim.min.map +1 -0
- data/vendor/assets/components/jquery/external/sizzle/LICENSE.txt +36 -0
- data/vendor/assets/components/jquery/external/sizzle/dist/sizzle.js +2272 -0
- data/vendor/assets/components/jquery/external/sizzle/dist/sizzle.min.js +3 -0
- data/vendor/assets/components/jquery/external/sizzle/dist/sizzle.min.map +1 -0
- data/vendor/assets/components/jquery/src/.eslintrc.json +5 -0
- data/vendor/assets/components/jquery/src/ajax.js +856 -0
- data/vendor/assets/components/jquery/src/ajax/jsonp.js +103 -0
- data/vendor/assets/components/jquery/src/ajax/load.js +77 -0
- data/vendor/assets/components/jquery/src/ajax/parseXML.js +30 -0
- data/vendor/assets/components/jquery/src/ajax/script.js +77 -0
- data/vendor/assets/components/jquery/src/ajax/var/location.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/var/nonce.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/var/rquery.js +5 -0
- data/vendor/assets/components/jquery/src/ajax/xhr.js +170 -0
- data/vendor/assets/components/jquery/src/attributes.js +13 -0
- data/vendor/assets/components/jquery/src/attributes/attr.js +141 -0
- data/vendor/assets/components/jquery/src/attributes/classes.js +186 -0
- data/vendor/assets/components/jquery/src/attributes/prop.js +143 -0
- data/vendor/assets/components/jquery/src/attributes/support.js +33 -0
- data/vendor/assets/components/jquery/src/attributes/val.js +191 -0
- data/vendor/assets/components/jquery/src/callbacks.js +236 -0
- data/vendor/assets/components/jquery/src/core.js +399 -0
- data/vendor/assets/components/jquery/src/core/DOMEval.js +30 -0
- data/vendor/assets/components/jquery/src/core/access.js +72 -0
- data/vendor/assets/components/jquery/src/core/camelCase.js +23 -0
- data/vendor/assets/components/jquery/src/core/init.js +129 -0
- data/vendor/assets/components/jquery/src/core/nodeName.js +13 -0
- data/vendor/assets/components/jquery/src/core/parseHTML.js +65 -0
- data/vendor/assets/components/jquery/src/core/ready-no-deferred.js +97 -0
- data/vendor/assets/components/jquery/src/core/ready.js +86 -0
- data/vendor/assets/components/jquery/src/core/readyException.js +13 -0
- data/vendor/assets/components/jquery/src/core/stripAndCollapse.js +14 -0
- data/vendor/assets/components/jquery/src/core/support.js +20 -0
- data/vendor/assets/components/jquery/src/core/toType.js +20 -0
- data/vendor/assets/components/jquery/src/core/var/rsingleTag.js +6 -0
- data/vendor/assets/components/jquery/src/css.js +481 -0
- data/vendor/assets/components/jquery/src/css/addGetHookIf.js +26 -0
- data/vendor/assets/components/jquery/src/css/adjustCSS.js +73 -0
- data/vendor/assets/components/jquery/src/css/curCSS.js +65 -0
- data/vendor/assets/components/jquery/src/css/hiddenVisibleSelectors.js +15 -0
- data/vendor/assets/components/jquery/src/css/showHide.js +105 -0
- data/vendor/assets/components/jquery/src/css/support.js +102 -0
- data/vendor/assets/components/jquery/src/css/var/cssExpand.js +5 -0
- data/vendor/assets/components/jquery/src/css/var/getStyles.js +17 -0
- data/vendor/assets/components/jquery/src/css/var/isHiddenWithinTree.js +34 -0
- data/vendor/assets/components/jquery/src/css/var/rboxStyle.js +7 -0
- data/vendor/assets/components/jquery/src/css/var/rnumnonpx.js +7 -0
- data/vendor/assets/components/jquery/src/css/var/swap.js +26 -0
- data/vendor/assets/components/jquery/src/data.js +180 -0
- data/vendor/assets/components/jquery/src/data/Data.js +162 -0
- data/vendor/assets/components/jquery/src/data/var/acceptData.js +19 -0
- data/vendor/assets/components/jquery/src/data/var/dataPriv.js +7 -0
- data/vendor/assets/components/jquery/src/data/var/dataUser.js +7 -0
- data/vendor/assets/components/jquery/src/deferred.js +399 -0
- data/vendor/assets/components/jquery/src/deferred/exceptionHook.js +21 -0
- data/vendor/assets/components/jquery/src/deprecated.js +98 -0
- data/vendor/assets/components/jquery/src/dimensions.js +57 -0
- data/vendor/assets/components/jquery/src/effects.js +702 -0
- data/vendor/assets/components/jquery/src/effects/Tween.js +123 -0
- data/vendor/assets/components/jquery/src/effects/animatedSelector.js +15 -0
- data/vendor/assets/components/jquery/src/event.js +748 -0
- data/vendor/assets/components/jquery/src/event/ajax.js +22 -0
- data/vendor/assets/components/jquery/src/event/alias.js +29 -0
- data/vendor/assets/components/jquery/src/event/focusin.js +55 -0
- data/vendor/assets/components/jquery/src/event/support.js +11 -0
- data/vendor/assets/components/jquery/src/event/trigger.js +199 -0
- data/vendor/assets/components/jquery/src/exports/amd.js +26 -0
- data/vendor/assets/components/jquery/src/exports/global.js +34 -0
- data/vendor/assets/components/jquery/src/jquery.js +40 -0
- data/vendor/assets/components/jquery/src/manipulation.js +486 -0
- data/vendor/assets/components/jquery/src/manipulation/_evalUrl.js +23 -0
- data/vendor/assets/components/jquery/src/manipulation/buildFragment.js +105 -0
- data/vendor/assets/components/jquery/src/manipulation/getAll.js +32 -0
- data/vendor/assets/components/jquery/src/manipulation/setGlobalEval.js +22 -0
- data/vendor/assets/components/jquery/src/manipulation/support.js +35 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rcheckableType.js +5 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rscriptType.js +5 -0
- data/vendor/assets/components/jquery/src/manipulation/var/rtagName.js +5 -0
- data/vendor/assets/components/jquery/src/manipulation/wrapMap.js +29 -0
- data/vendor/assets/components/jquery/src/offset.js +233 -0
- data/vendor/assets/components/jquery/src/queue.js +145 -0
- data/vendor/assets/components/jquery/src/queue/delay.js +24 -0
- data/vendor/assets/components/jquery/src/selector-native.js +237 -0
- data/vendor/assets/components/jquery/src/selector-sizzle.js +19 -0
- data/vendor/assets/components/jquery/src/selector.js +3 -0
- data/vendor/assets/components/jquery/src/serialize.js +132 -0
- data/vendor/assets/components/jquery/src/traversing.js +191 -0
- data/vendor/assets/components/jquery/src/traversing/findFilter.js +97 -0
- data/vendor/assets/components/jquery/src/traversing/var/dir.js +22 -0
- data/vendor/assets/components/jquery/src/traversing/var/rneedsContext.js +8 -0
- data/vendor/assets/components/jquery/src/traversing/var/siblings.js +17 -0
- data/vendor/assets/components/jquery/src/var/ObjectFunctionString.js +7 -0
- data/vendor/assets/components/jquery/src/var/arr.js +5 -0
- data/vendor/assets/components/jquery/src/var/class2type.js +6 -0
- data/vendor/assets/components/jquery/src/var/concat.js +7 -0
- data/vendor/assets/components/jquery/src/var/document.js +5 -0
- data/vendor/assets/components/jquery/src/var/documentElement.js +7 -0
- data/vendor/assets/components/jquery/src/var/fnToString.js +7 -0
- data/vendor/assets/components/jquery/src/var/getProto.js +5 -0
- data/vendor/assets/components/jquery/src/var/hasOwn.js +7 -0
- data/vendor/assets/components/jquery/src/var/indexOf.js +7 -0
- data/vendor/assets/components/jquery/src/var/isFunction.js +13 -0
- data/vendor/assets/components/jquery/src/var/isWindow.js +8 -0
- data/vendor/assets/components/jquery/src/var/pnum.js +5 -0
- data/vendor/assets/components/jquery/src/var/push.js +7 -0
- data/vendor/assets/components/jquery/src/var/rcssNum.js +9 -0
- data/vendor/assets/components/jquery/src/var/rnothtmlwhite.js +8 -0
- data/vendor/assets/components/jquery/src/var/slice.js +7 -0
- data/vendor/assets/components/jquery/src/var/support.js +6 -0
- data/vendor/assets/components/jquery/src/var/toString.js +7 -0
- data/vendor/assets/components/jquery/src/wrap.js +78 -0
- data/vendor/assets/components/markdown-it/.bower.json +38 -0
- data/vendor/assets/components/markdown-it/CHANGELOG.md +442 -0
- data/vendor/assets/components/markdown-it/CONTRIBUTING.md +15 -0
- data/vendor/assets/components/markdown-it/LICENSE +22 -0
- data/vendor/assets/components/markdown-it/Procfile +1 -0
- data/vendor/assets/components/markdown-it/README.md +294 -0
- data/vendor/assets/components/markdown-it/bin/markdown-it.js +113 -0
- data/vendor/assets/components/markdown-it/bower.json +28 -0
- data/vendor/assets/components/markdown-it/dist/markdown-it.js +7963 -0
- data/vendor/assets/components/markdown-it/dist/markdown-it.min.js +1 -0
- data/vendor/assets/components/markdown-it/package.json +64 -0
- data/vendor/assets/components/plantuml-encoder/.bower.json +29 -0
- data/vendor/assets/components/plantuml-encoder/LICENSE +19 -0
- data/vendor/assets/components/plantuml-encoder/README.md +38 -0
- data/vendor/assets/components/plantuml-encoder/bower.json +20 -0
- data/vendor/assets/components/plantuml-encoder/dist/plantuml-encoder.js +3994 -0
- data/vendor/assets/components/plantuml-encoder/dist/plantuml-encoder.min.js +1 -0
- data/vendor/assets/components/plantuml-encoder/package.json +33 -0
- data/vendor/assets/components/raphael/.bower.json +45 -0
- data/vendor/assets/components/raphael/bower.json +31 -0
- data/vendor/assets/components/raphael/dev/banner.txt +8 -0
- data/vendor/assets/components/raphael/dev/raphael.amd.js +14 -0
- data/vendor/assets/components/raphael/dev/raphael.core.js +5413 -0
- data/vendor/assets/components/raphael/dev/raphael.svg.js +1428 -0
- data/vendor/assets/components/raphael/dev/raphael.vml.js +1010 -0
- data/vendor/assets/components/raphael/dev/test/svg/dom.js +295 -0
- data/vendor/assets/components/raphael/dev/test/vml/dom.js +5 -0
- data/vendor/assets/components/raphael/license.txt +21 -0
- data/vendor/assets/components/raphael/raphael.js +8330 -0
- data/vendor/assets/components/raphael/raphael.min.js +3 -0
- data/vendor/assets/components/raphael/raphael.no-deps.js +7959 -0
- data/vendor/assets/components/raphael/raphael.no-deps.min.js +3 -0
- data/vendor/assets/components/raphael/webpack.config.js +62 -0
- data/vendor/assets/components/squire-rte/.bower.json +34 -0
- data/vendor/assets/components/squire-rte/Demo.html +143 -0
- data/vendor/assets/components/squire-rte/LICENSE +21 -0
- data/vendor/assets/components/squire-rte/Makefile +22 -0
- data/vendor/assets/components/squire-rte/README.md +473 -0
- data/vendor/assets/components/squire-rte/bower.json +24 -0
- data/vendor/assets/components/squire-rte/build/document.html +54 -0
- data/vendor/assets/components/squire-rte/build/squire-raw.js +4722 -0
- data/vendor/assets/components/squire-rte/build/squire.js +2 -0
- data/vendor/assets/components/squire-rte/package.json +31 -0
- data/vendor/assets/components/squire-rte/source/Clean.js +358 -0
- data/vendor/assets/components/squire-rte/source/Clipboard.js +331 -0
- data/vendor/assets/components/squire-rte/source/Constants.js +60 -0
- data/vendor/assets/components/squire-rte/source/Editor.js +2201 -0
- data/vendor/assets/components/squire-rte/source/KeyHandlers.js +502 -0
- data/vendor/assets/components/squire-rte/source/Node.js +553 -0
- data/vendor/assets/components/squire-rte/source/Range.js +540 -0
- data/vendor/assets/components/squire-rte/source/TreeWalker.js +118 -0
- data/vendor/assets/components/squire-rte/source/document.html +54 -0
- data/vendor/assets/components/squire-rte/source/exports.js +42 -0
- data/vendor/assets/components/squire-rte/source/intro.js +6 -0
- data/vendor/assets/components/squire-rte/source/outro.js +22 -0
- data/vendor/assets/components/to-mark/.bower.json +35 -0
- data/vendor/assets/components/to-mark/bower.json +22 -0
- data/vendor/assets/components/to-mark/demo/demo.html +24 -0
- data/vendor/assets/components/to-mark/demo/demo2.html +94 -0
- data/vendor/assets/components/to-mark/dist/to-mark.js +1283 -0
- data/vendor/assets/components/to-mark/dist/to-mark.min.js +1 -0
- data/vendor/assets/components/to-mark/gulpfile.js +112 -0
- data/vendor/assets/components/to-mark/karma.conf.js +260 -0
- data/vendor/assets/components/to-mark/package-lock.json +13061 -0
- data/vendor/assets/components/to-mark/package.json +53 -0
- data/vendor/assets/components/tui-chart/.bower.json +44 -0
- data/vendor/assets/components/tui-chart/CODE_OF_CONDUCT.md +73 -0
- data/vendor/assets/components/tui-chart/CONTRIBUTING.md +91 -0
- data/vendor/assets/components/tui-chart/LICENSE +21 -0
- data/vendor/assets/components/tui-chart/README.md +142 -0
- data/vendor/assets/components/tui-chart/bower.json +33 -0
- data/vendor/assets/components/tui-chart/dist/maps/china.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/japan.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/singapore.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/south-korea.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/taiwan.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/thailand.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/usa.js +10 -0
- data/vendor/assets/components/tui-chart/dist/maps/world.js +11 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.css +704 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.js +40567 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.min.css +10 -0
- data/vendor/assets/components/tui-chart/dist/tui-chart.min.js +20 -0
- data/vendor/assets/components/tui-chart/docs/COMMIT_MESSAGE_CONVENTION.md +49 -0
- data/vendor/assets/components/tui-chart/docs/ISSUE_TEMPLATE.md +24 -0
- data/vendor/assets/components/tui-chart/docs/PULL_REQUEST_TEMPLATE.md +42 -0
- data/vendor/assets/components/tui-chart/docs/README.md +11 -0
- data/vendor/assets/components/tui-chart/docs/wiki/README.md +27 -0
- data/vendor/assets/components/tui-chart/docs/wiki/_Sidebar.md +31 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-export-menu.md +66 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-type-radial.md +121 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-bar,column.md +312 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-bubble.md +63 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-column-line-combo.md +104 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-heatmap.md +39 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-line,area.md +333 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-line-area-combo.md +78 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-line-scatter-combo.md +101 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-map.md +153 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-pie-donut-combo.md +98 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-pie.md +186 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-scatter.md +58 -0
- data/vendor/assets/components/tui-chart/docs/wiki/chart-types-treemap.md +158 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-china-map.md +38 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-japan-map.md +51 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-singapore-map.md +9 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-south-korea-map.md +21 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-taiwan-map.md +26 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-thailand-map.md +82 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-usa-map.md +55 -0
- data/vendor/assets/components/tui-chart/docs/wiki/code-table-of-world-map.md +180 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-axes.md +209 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-chart.md +157 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-circle-legend.md +20 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-legend.md +89 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-plot.md +141 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-series.md +240 -0
- data/vendor/assets/components/tui-chart/docs/wiki/features-tooltip.md +223 -0
- data/vendor/assets/components/tui-chart/docs/wiki/getting-started.md +74 -0
- data/vendor/assets/components/tui-chart/docs/wiki/import-chart-data-from-existing-table-element.md +150 -0
- data/vendor/assets/components/tui-chart/docs/wiki/table-of-supported-options.md +344 -0
- data/vendor/assets/components/tui-chart/docs/wiki/theme.md +338 -0
- data/vendor/assets/components/tui-chart/package-lock.json +8881 -0
- data/vendor/assets/components/tui-code-snippet/.bower.json +31 -0
- data/vendor/assets/components/tui-code-snippet/LICENSE +21 -0
- data/vendor/assets/components/tui-code-snippet/README.md +109 -0
- data/vendor/assets/components/tui-code-snippet/bower.json +20 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/README.md +26 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/public/popup.html +27 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/public/postBridge.html +31 -0
- data/vendor/assets/components/tui-code-snippet/demo/postBridge/server.js +28 -0
- data/vendor/assets/components/tui-code-snippet/dist/tui-code-snippet.js +4228 -0
- data/vendor/assets/components/tui-code-snippet/dist/tui-code-snippet.min.js +7 -0
- data/vendor/assets/components/tui-code-snippet/package-lock.json +6038 -0
- data/vendor/assets/components/tui-color-picker/.bower.json +37 -0
- data/vendor/assets/components/tui-color-picker/ISSUE_TEMPLATE.md +26 -0
- data/vendor/assets/components/tui-color-picker/LICENSE +34 -0
- data/vendor/assets/components/tui-color-picker/README.md +69 -0
- data/vendor/assets/components/tui-color-picker/bower.json +26 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.css +148 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.js +3146 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.min.css +7 -0
- data/vendor/assets/components/tui-color-picker/dist/tui-color-picker.min.js +9 -0
- data/vendor/assets/components/tui-color-picker/package-lock.json +8440 -0
- data/vendor/assets/components/tui-editor/.bower.json +71 -0
- data/vendor/assets/components/tui-editor/CODE_OF_CONDUCT.md +73 -0
- data/vendor/assets/components/tui-editor/CONTRIBUTING.md +92 -0
- data/vendor/assets/components/tui-editor/LICENSE +21 -0
- data/vendor/assets/components/tui-editor/README.md +204 -0
- data/vendor/assets/components/tui-editor/bower.json +59 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor-all.js +36850 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor-all.min.js +13 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor.js +24646 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Editor.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer-all.js +14768 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer-all.min.js +13 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer.js +3686 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-Viewer.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-contents.css +239 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-contents.min.css +1 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extChart.js +7040 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extChart.min.js +13 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extColorSyntax.js +472 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extColorSyntax.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extScrollSync.js +1241 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extScrollSync.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extTable.js +3930 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extTable.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extUML.js +212 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor-extUML.min.js +7 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor.css +1166 -0
- data/vendor/assets/components/tui-editor/dist/tui-editor.min.css +1 -0
- data/vendor/assets/components/tui-editor/docs/COMMIT_MESSAGE_CONVENTION.md +49 -0
- data/vendor/assets/components/tui-editor/docs/PULL_REQUEST_TEMPLATE.md +41 -0
- data/vendor/assets/components/tui-editor/docs/README.md +13 -0
- data/vendor/assets/components/tui-editor/docs/getting-started-with-bower.md +93 -0
- data/vendor/assets/components/tui-editor/docs/getting-started.md +76 -0
- data/vendor/assets/components/tui-editor/docs/using-extensions.md +91 -0
- data/vendor/assets/components/tui-editor/docs/writing-your-own-extension.md +167 -0
- data/vendor/assets/components/tui-editor/examples/example00-demo.html +85 -0
- data/vendor/assets/components/tui-editor/examples/example01-basic.html +37 -0
- data/vendor/assets/components/tui-editor/examples/example02-viewer-basic.html +68 -0
- data/vendor/assets/components/tui-editor/examples/example03-jquery.html +36 -0
- data/vendor/assets/components/tui-editor/examples/example04-viewer-jquery.html +67 -0
- data/vendor/assets/components/tui-editor/examples/example05-scrollsync.html +77 -0
- data/vendor/assets/components/tui-editor/examples/example06-colorsyntax.html +44 -0
- data/vendor/assets/components/tui-editor/examples/example07-table.html +48 -0
- data/vendor/assets/components/tui-editor/examples/example08-uml.html +69 -0
- data/vendor/assets/components/tui-editor/examples/example09-multiple-extensions.html +85 -0
- data/vendor/assets/components/tui-editor/examples/example10-viewer-multiple-extensions.html +86 -0
- data/vendor/assets/components/tui-editor/examples/example11-chart.html +60 -0
- data/vendor/assets/components/tui-editor/examples/example12-writing-extension.html +66 -0
- data/vendor/assets/components/tui-editor/examples/examples.json +41 -0
- data/vendor/assets/components/tui-editor/examples/explain.css +7 -0
- data/vendor/assets/components/tui-editor/package-lock.json +13289 -0
- data/vendor/assets/components/tui-editor/package.json +90 -0
- metadata +956 -0
@@ -0,0 +1,280 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
/**
|
5
|
+
* Link to the project's GitHub page:
|
6
|
+
* https://github.com/duralog/CodeMirror
|
7
|
+
*/
|
8
|
+
|
9
|
+
(function(mod) {
|
10
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
11
|
+
mod(require("../../lib/codemirror"));
|
12
|
+
else if (typeof define == "function" && define.amd) // AMD
|
13
|
+
define(["../../lib/codemirror"], mod);
|
14
|
+
else // Plain browser env
|
15
|
+
mod(CodeMirror);
|
16
|
+
})(function(CodeMirror) {
|
17
|
+
"use strict";
|
18
|
+
|
19
|
+
CodeMirror.defineMode('livescript', function(){
|
20
|
+
var tokenBase = function(stream, state) {
|
21
|
+
var next_rule = state.next || "start";
|
22
|
+
if (next_rule) {
|
23
|
+
state.next = state.next;
|
24
|
+
var nr = Rules[next_rule];
|
25
|
+
if (nr.splice) {
|
26
|
+
for (var i$ = 0; i$ < nr.length; ++i$) {
|
27
|
+
var r = nr[i$];
|
28
|
+
if (r.regex && stream.match(r.regex)) {
|
29
|
+
state.next = r.next || state.next;
|
30
|
+
return r.token;
|
31
|
+
}
|
32
|
+
}
|
33
|
+
stream.next();
|
34
|
+
return 'error';
|
35
|
+
}
|
36
|
+
if (stream.match(r = Rules[next_rule])) {
|
37
|
+
if (r.regex && stream.match(r.regex)) {
|
38
|
+
state.next = r.next;
|
39
|
+
return r.token;
|
40
|
+
} else {
|
41
|
+
stream.next();
|
42
|
+
return 'error';
|
43
|
+
}
|
44
|
+
}
|
45
|
+
}
|
46
|
+
stream.next();
|
47
|
+
return 'error';
|
48
|
+
};
|
49
|
+
var external = {
|
50
|
+
startState: function(){
|
51
|
+
return {
|
52
|
+
next: 'start',
|
53
|
+
lastToken: {style: null, indent: 0, content: ""}
|
54
|
+
};
|
55
|
+
},
|
56
|
+
token: function(stream, state){
|
57
|
+
while (stream.pos == stream.start)
|
58
|
+
var style = tokenBase(stream, state);
|
59
|
+
state.lastToken = {
|
60
|
+
style: style,
|
61
|
+
indent: stream.indentation(),
|
62
|
+
content: stream.current()
|
63
|
+
};
|
64
|
+
return style.replace(/\./g, ' ');
|
65
|
+
},
|
66
|
+
indent: function(state){
|
67
|
+
var indentation = state.lastToken.indent;
|
68
|
+
if (state.lastToken.content.match(indenter)) {
|
69
|
+
indentation += 2;
|
70
|
+
}
|
71
|
+
return indentation;
|
72
|
+
}
|
73
|
+
};
|
74
|
+
return external;
|
75
|
+
});
|
76
|
+
|
77
|
+
var identifier = '(?![\\d\\s])[$\\w\\xAA-\\uFFDC](?:(?!\\s)[$\\w\\xAA-\\uFFDC]|-[A-Za-z])*';
|
78
|
+
var indenter = RegExp('(?:[({[=:]|[-~]>|\\b(?:e(?:lse|xport)|d(?:o|efault)|t(?:ry|hen)|finally|import(?:\\s*all)?|const|var|let|new|catch(?:\\s*' + identifier + ')?))\\s*$');
|
79
|
+
var keywordend = '(?![$\\w]|-[A-Za-z]|\\s*:(?![:=]))';
|
80
|
+
var stringfill = {
|
81
|
+
token: 'string',
|
82
|
+
regex: '.+'
|
83
|
+
};
|
84
|
+
var Rules = {
|
85
|
+
start: [
|
86
|
+
{
|
87
|
+
token: 'comment.doc',
|
88
|
+
regex: '/\\*',
|
89
|
+
next: 'comment'
|
90
|
+
}, {
|
91
|
+
token: 'comment',
|
92
|
+
regex: '#.*'
|
93
|
+
}, {
|
94
|
+
token: 'keyword',
|
95
|
+
regex: '(?:t(?:h(?:is|row|en)|ry|ypeof!?)|c(?:on(?:tinue|st)|a(?:se|tch)|lass)|i(?:n(?:stanceof)?|mp(?:ort(?:\\s+all)?|lements)|[fs])|d(?:e(?:fault|lete|bugger)|o)|f(?:or(?:\\s+own)?|inally|unction)|s(?:uper|witch)|e(?:lse|x(?:tends|port)|val)|a(?:nd|rguments)|n(?:ew|ot)|un(?:less|til)|w(?:hile|ith)|o[fr]|return|break|let|var|loop)' + keywordend
|
96
|
+
}, {
|
97
|
+
token: 'constant.language',
|
98
|
+
regex: '(?:true|false|yes|no|on|off|null|void|undefined)' + keywordend
|
99
|
+
}, {
|
100
|
+
token: 'invalid.illegal',
|
101
|
+
regex: '(?:p(?:ackage|r(?:ivate|otected)|ublic)|i(?:mplements|nterface)|enum|static|yield)' + keywordend
|
102
|
+
}, {
|
103
|
+
token: 'language.support.class',
|
104
|
+
regex: '(?:R(?:e(?:gExp|ferenceError)|angeError)|S(?:tring|yntaxError)|E(?:rror|valError)|Array|Boolean|Date|Function|Number|Object|TypeError|URIError)' + keywordend
|
105
|
+
}, {
|
106
|
+
token: 'language.support.function',
|
107
|
+
regex: '(?:is(?:NaN|Finite)|parse(?:Int|Float)|Math|JSON|(?:en|de)codeURI(?:Component)?)' + keywordend
|
108
|
+
}, {
|
109
|
+
token: 'variable.language',
|
110
|
+
regex: '(?:t(?:hat|il|o)|f(?:rom|allthrough)|it|by|e)' + keywordend
|
111
|
+
}, {
|
112
|
+
token: 'identifier',
|
113
|
+
regex: identifier + '\\s*:(?![:=])'
|
114
|
+
}, {
|
115
|
+
token: 'variable',
|
116
|
+
regex: identifier
|
117
|
+
}, {
|
118
|
+
token: 'keyword.operator',
|
119
|
+
regex: '(?:\\.{3}|\\s+\\?)'
|
120
|
+
}, {
|
121
|
+
token: 'keyword.variable',
|
122
|
+
regex: '(?:@+|::|\\.\\.)',
|
123
|
+
next: 'key'
|
124
|
+
}, {
|
125
|
+
token: 'keyword.operator',
|
126
|
+
regex: '\\.\\s*',
|
127
|
+
next: 'key'
|
128
|
+
}, {
|
129
|
+
token: 'string',
|
130
|
+
regex: '\\\\\\S[^\\s,;)}\\]]*'
|
131
|
+
}, {
|
132
|
+
token: 'string.doc',
|
133
|
+
regex: '\'\'\'',
|
134
|
+
next: 'qdoc'
|
135
|
+
}, {
|
136
|
+
token: 'string.doc',
|
137
|
+
regex: '"""',
|
138
|
+
next: 'qqdoc'
|
139
|
+
}, {
|
140
|
+
token: 'string',
|
141
|
+
regex: '\'',
|
142
|
+
next: 'qstring'
|
143
|
+
}, {
|
144
|
+
token: 'string',
|
145
|
+
regex: '"',
|
146
|
+
next: 'qqstring'
|
147
|
+
}, {
|
148
|
+
token: 'string',
|
149
|
+
regex: '`',
|
150
|
+
next: 'js'
|
151
|
+
}, {
|
152
|
+
token: 'string',
|
153
|
+
regex: '<\\[',
|
154
|
+
next: 'words'
|
155
|
+
}, {
|
156
|
+
token: 'string.regex',
|
157
|
+
regex: '//',
|
158
|
+
next: 'heregex'
|
159
|
+
}, {
|
160
|
+
token: 'string.regex',
|
161
|
+
regex: '\\/(?:[^[\\/\\n\\\\]*(?:(?:\\\\.|\\[[^\\]\\n\\\\]*(?:\\\\.[^\\]\\n\\\\]*)*\\])[^[\\/\\n\\\\]*)*)\\/[gimy$]{0,4}',
|
162
|
+
next: 'key'
|
163
|
+
}, {
|
164
|
+
token: 'constant.numeric',
|
165
|
+
regex: '(?:0x[\\da-fA-F][\\da-fA-F_]*|(?:[2-9]|[12]\\d|3[0-6])r[\\da-zA-Z][\\da-zA-Z_]*|(?:\\d[\\d_]*(?:\\.\\d[\\d_]*)?|\\.\\d[\\d_]*)(?:e[+-]?\\d[\\d_]*)?[\\w$]*)'
|
166
|
+
}, {
|
167
|
+
token: 'lparen',
|
168
|
+
regex: '[({[]'
|
169
|
+
}, {
|
170
|
+
token: 'rparen',
|
171
|
+
regex: '[)}\\]]',
|
172
|
+
next: 'key'
|
173
|
+
}, {
|
174
|
+
token: 'keyword.operator',
|
175
|
+
regex: '\\S+'
|
176
|
+
}, {
|
177
|
+
token: 'text',
|
178
|
+
regex: '\\s+'
|
179
|
+
}
|
180
|
+
],
|
181
|
+
heregex: [
|
182
|
+
{
|
183
|
+
token: 'string.regex',
|
184
|
+
regex: '.*?//[gimy$?]{0,4}',
|
185
|
+
next: 'start'
|
186
|
+
}, {
|
187
|
+
token: 'string.regex',
|
188
|
+
regex: '\\s*#{'
|
189
|
+
}, {
|
190
|
+
token: 'comment.regex',
|
191
|
+
regex: '\\s+(?:#.*)?'
|
192
|
+
}, {
|
193
|
+
token: 'string.regex',
|
194
|
+
regex: '\\S+'
|
195
|
+
}
|
196
|
+
],
|
197
|
+
key: [
|
198
|
+
{
|
199
|
+
token: 'keyword.operator',
|
200
|
+
regex: '[.?@!]+'
|
201
|
+
}, {
|
202
|
+
token: 'identifier',
|
203
|
+
regex: identifier,
|
204
|
+
next: 'start'
|
205
|
+
}, {
|
206
|
+
token: 'text',
|
207
|
+
regex: '',
|
208
|
+
next: 'start'
|
209
|
+
}
|
210
|
+
],
|
211
|
+
comment: [
|
212
|
+
{
|
213
|
+
token: 'comment.doc',
|
214
|
+
regex: '.*?\\*/',
|
215
|
+
next: 'start'
|
216
|
+
}, {
|
217
|
+
token: 'comment.doc',
|
218
|
+
regex: '.+'
|
219
|
+
}
|
220
|
+
],
|
221
|
+
qdoc: [
|
222
|
+
{
|
223
|
+
token: 'string',
|
224
|
+
regex: ".*?'''",
|
225
|
+
next: 'key'
|
226
|
+
}, stringfill
|
227
|
+
],
|
228
|
+
qqdoc: [
|
229
|
+
{
|
230
|
+
token: 'string',
|
231
|
+
regex: '.*?"""',
|
232
|
+
next: 'key'
|
233
|
+
}, stringfill
|
234
|
+
],
|
235
|
+
qstring: [
|
236
|
+
{
|
237
|
+
token: 'string',
|
238
|
+
regex: '[^\\\\\']*(?:\\\\.[^\\\\\']*)*\'',
|
239
|
+
next: 'key'
|
240
|
+
}, stringfill
|
241
|
+
],
|
242
|
+
qqstring: [
|
243
|
+
{
|
244
|
+
token: 'string',
|
245
|
+
regex: '[^\\\\"]*(?:\\\\.[^\\\\"]*)*"',
|
246
|
+
next: 'key'
|
247
|
+
}, stringfill
|
248
|
+
],
|
249
|
+
js: [
|
250
|
+
{
|
251
|
+
token: 'string',
|
252
|
+
regex: '[^\\\\`]*(?:\\\\.[^\\\\`]*)*`',
|
253
|
+
next: 'key'
|
254
|
+
}, stringfill
|
255
|
+
],
|
256
|
+
words: [
|
257
|
+
{
|
258
|
+
token: 'string',
|
259
|
+
regex: '.*?\\]>',
|
260
|
+
next: 'key'
|
261
|
+
}, stringfill
|
262
|
+
]
|
263
|
+
};
|
264
|
+
for (var idx in Rules) {
|
265
|
+
var r = Rules[idx];
|
266
|
+
if (r.splice) {
|
267
|
+
for (var i = 0, len = r.length; i < len; ++i) {
|
268
|
+
var rr = r[i];
|
269
|
+
if (typeof rr.regex === 'string') {
|
270
|
+
Rules[idx][i].regex = new RegExp('^' + rr.regex);
|
271
|
+
}
|
272
|
+
}
|
273
|
+
} else if (typeof rr.regex === 'string') {
|
274
|
+
Rules[idx].regex = new RegExp('^' + r.regex);
|
275
|
+
}
|
276
|
+
}
|
277
|
+
|
278
|
+
CodeMirror.defineMIME('text/x-livescript', 'livescript');
|
279
|
+
|
280
|
+
});
|
@@ -0,0 +1,159 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
// LUA mode. Ported to CodeMirror 2 from Franciszek Wawrzak's
|
5
|
+
// CodeMirror 1 mode.
|
6
|
+
// highlights keywords, strings, comments (no leveling supported! ("[==[")), tokens, basic indenting
|
7
|
+
|
8
|
+
(function(mod) {
|
9
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
10
|
+
mod(require("../../lib/codemirror"));
|
11
|
+
else if (typeof define == "function" && define.amd) // AMD
|
12
|
+
define(["../../lib/codemirror"], mod);
|
13
|
+
else // Plain browser env
|
14
|
+
mod(CodeMirror);
|
15
|
+
})(function(CodeMirror) {
|
16
|
+
"use strict";
|
17
|
+
|
18
|
+
CodeMirror.defineMode("lua", function(config, parserConfig) {
|
19
|
+
var indentUnit = config.indentUnit;
|
20
|
+
|
21
|
+
function prefixRE(words) {
|
22
|
+
return new RegExp("^(?:" + words.join("|") + ")", "i");
|
23
|
+
}
|
24
|
+
function wordRE(words) {
|
25
|
+
return new RegExp("^(?:" + words.join("|") + ")$", "i");
|
26
|
+
}
|
27
|
+
var specials = wordRE(parserConfig.specials || []);
|
28
|
+
|
29
|
+
// long list of standard functions from lua manual
|
30
|
+
var builtins = wordRE([
|
31
|
+
"_G","_VERSION","assert","collectgarbage","dofile","error","getfenv","getmetatable","ipairs","load",
|
32
|
+
"loadfile","loadstring","module","next","pairs","pcall","print","rawequal","rawget","rawset","require",
|
33
|
+
"select","setfenv","setmetatable","tonumber","tostring","type","unpack","xpcall",
|
34
|
+
|
35
|
+
"coroutine.create","coroutine.resume","coroutine.running","coroutine.status","coroutine.wrap","coroutine.yield",
|
36
|
+
|
37
|
+
"debug.debug","debug.getfenv","debug.gethook","debug.getinfo","debug.getlocal","debug.getmetatable",
|
38
|
+
"debug.getregistry","debug.getupvalue","debug.setfenv","debug.sethook","debug.setlocal","debug.setmetatable",
|
39
|
+
"debug.setupvalue","debug.traceback",
|
40
|
+
|
41
|
+
"close","flush","lines","read","seek","setvbuf","write",
|
42
|
+
|
43
|
+
"io.close","io.flush","io.input","io.lines","io.open","io.output","io.popen","io.read","io.stderr","io.stdin",
|
44
|
+
"io.stdout","io.tmpfile","io.type","io.write",
|
45
|
+
|
46
|
+
"math.abs","math.acos","math.asin","math.atan","math.atan2","math.ceil","math.cos","math.cosh","math.deg",
|
47
|
+
"math.exp","math.floor","math.fmod","math.frexp","math.huge","math.ldexp","math.log","math.log10","math.max",
|
48
|
+
"math.min","math.modf","math.pi","math.pow","math.rad","math.random","math.randomseed","math.sin","math.sinh",
|
49
|
+
"math.sqrt","math.tan","math.tanh",
|
50
|
+
|
51
|
+
"os.clock","os.date","os.difftime","os.execute","os.exit","os.getenv","os.remove","os.rename","os.setlocale",
|
52
|
+
"os.time","os.tmpname",
|
53
|
+
|
54
|
+
"package.cpath","package.loaded","package.loaders","package.loadlib","package.path","package.preload",
|
55
|
+
"package.seeall",
|
56
|
+
|
57
|
+
"string.byte","string.char","string.dump","string.find","string.format","string.gmatch","string.gsub",
|
58
|
+
"string.len","string.lower","string.match","string.rep","string.reverse","string.sub","string.upper",
|
59
|
+
|
60
|
+
"table.concat","table.insert","table.maxn","table.remove","table.sort"
|
61
|
+
]);
|
62
|
+
var keywords = wordRE(["and","break","elseif","false","nil","not","or","return",
|
63
|
+
"true","function", "end", "if", "then", "else", "do",
|
64
|
+
"while", "repeat", "until", "for", "in", "local" ]);
|
65
|
+
|
66
|
+
var indentTokens = wordRE(["function", "if","repeat","do", "\\(", "{"]);
|
67
|
+
var dedentTokens = wordRE(["end", "until", "\\)", "}"]);
|
68
|
+
var dedentPartial = prefixRE(["end", "until", "\\)", "}", "else", "elseif"]);
|
69
|
+
|
70
|
+
function readBracket(stream) {
|
71
|
+
var level = 0;
|
72
|
+
while (stream.eat("=")) ++level;
|
73
|
+
stream.eat("[");
|
74
|
+
return level;
|
75
|
+
}
|
76
|
+
|
77
|
+
function normal(stream, state) {
|
78
|
+
var ch = stream.next();
|
79
|
+
if (ch == "-" && stream.eat("-")) {
|
80
|
+
if (stream.eat("[") && stream.eat("["))
|
81
|
+
return (state.cur = bracketed(readBracket(stream), "comment"))(stream, state);
|
82
|
+
stream.skipToEnd();
|
83
|
+
return "comment";
|
84
|
+
}
|
85
|
+
if (ch == "\"" || ch == "'")
|
86
|
+
return (state.cur = string(ch))(stream, state);
|
87
|
+
if (ch == "[" && /[\[=]/.test(stream.peek()))
|
88
|
+
return (state.cur = bracketed(readBracket(stream), "string"))(stream, state);
|
89
|
+
if (/\d/.test(ch)) {
|
90
|
+
stream.eatWhile(/[\w.%]/);
|
91
|
+
return "number";
|
92
|
+
}
|
93
|
+
if (/[\w_]/.test(ch)) {
|
94
|
+
stream.eatWhile(/[\w\\\-_.]/);
|
95
|
+
return "variable";
|
96
|
+
}
|
97
|
+
return null;
|
98
|
+
}
|
99
|
+
|
100
|
+
function bracketed(level, style) {
|
101
|
+
return function(stream, state) {
|
102
|
+
var curlev = null, ch;
|
103
|
+
while ((ch = stream.next()) != null) {
|
104
|
+
if (curlev == null) {if (ch == "]") curlev = 0;}
|
105
|
+
else if (ch == "=") ++curlev;
|
106
|
+
else if (ch == "]" && curlev == level) { state.cur = normal; break; }
|
107
|
+
else curlev = null;
|
108
|
+
}
|
109
|
+
return style;
|
110
|
+
};
|
111
|
+
}
|
112
|
+
|
113
|
+
function string(quote) {
|
114
|
+
return function(stream, state) {
|
115
|
+
var escaped = false, ch;
|
116
|
+
while ((ch = stream.next()) != null) {
|
117
|
+
if (ch == quote && !escaped) break;
|
118
|
+
escaped = !escaped && ch == "\\";
|
119
|
+
}
|
120
|
+
if (!escaped) state.cur = normal;
|
121
|
+
return "string";
|
122
|
+
};
|
123
|
+
}
|
124
|
+
|
125
|
+
return {
|
126
|
+
startState: function(basecol) {
|
127
|
+
return {basecol: basecol || 0, indentDepth: 0, cur: normal};
|
128
|
+
},
|
129
|
+
|
130
|
+
token: function(stream, state) {
|
131
|
+
if (stream.eatSpace()) return null;
|
132
|
+
var style = state.cur(stream, state);
|
133
|
+
var word = stream.current();
|
134
|
+
if (style == "variable") {
|
135
|
+
if (keywords.test(word)) style = "keyword";
|
136
|
+
else if (builtins.test(word)) style = "builtin";
|
137
|
+
else if (specials.test(word)) style = "variable-2";
|
138
|
+
}
|
139
|
+
if ((style != "comment") && (style != "string")){
|
140
|
+
if (indentTokens.test(word)) ++state.indentDepth;
|
141
|
+
else if (dedentTokens.test(word)) --state.indentDepth;
|
142
|
+
}
|
143
|
+
return style;
|
144
|
+
},
|
145
|
+
|
146
|
+
indent: function(state, textAfter) {
|
147
|
+
var closing = dedentPartial.test(textAfter);
|
148
|
+
return state.basecol + indentUnit * (state.indentDepth - (closing ? 1 : 0));
|
149
|
+
},
|
150
|
+
|
151
|
+
lineComment: "--",
|
152
|
+
blockCommentStart: "--[[",
|
153
|
+
blockCommentEnd: "]]"
|
154
|
+
};
|
155
|
+
});
|
156
|
+
|
157
|
+
CodeMirror.defineMIME("text/x-lua", "lua");
|
158
|
+
|
159
|
+
});
|
@@ -0,0 +1,872 @@
|
|
1
|
+
// CodeMirror, copyright (c) by Marijn Haverbeke and others
|
2
|
+
// Distributed under an MIT license: http://codemirror.net/LICENSE
|
3
|
+
|
4
|
+
(function(mod) {
|
5
|
+
if (typeof exports == "object" && typeof module == "object") // CommonJS
|
6
|
+
mod(require("../../lib/codemirror"), require("../xml/xml"), require("../meta"));
|
7
|
+
else if (typeof define == "function" && define.amd) // AMD
|
8
|
+
define(["../../lib/codemirror", "../xml/xml", "../meta"], mod);
|
9
|
+
else // Plain browser env
|
10
|
+
mod(CodeMirror);
|
11
|
+
})(function(CodeMirror) {
|
12
|
+
"use strict";
|
13
|
+
|
14
|
+
CodeMirror.defineMode("markdown", function(cmCfg, modeCfg) {
|
15
|
+
|
16
|
+
var htmlMode = CodeMirror.getMode(cmCfg, "text/html");
|
17
|
+
var htmlModeMissing = htmlMode.name == "null"
|
18
|
+
|
19
|
+
function getMode(name) {
|
20
|
+
if (CodeMirror.findModeByName) {
|
21
|
+
var found = CodeMirror.findModeByName(name);
|
22
|
+
if (found) name = found.mime || found.mimes[0];
|
23
|
+
}
|
24
|
+
var mode = CodeMirror.getMode(cmCfg, name);
|
25
|
+
return mode.name == "null" ? null : mode;
|
26
|
+
}
|
27
|
+
|
28
|
+
// Should characters that affect highlighting be highlighted separate?
|
29
|
+
// Does not include characters that will be output (such as `1.` and `-` for lists)
|
30
|
+
if (modeCfg.highlightFormatting === undefined)
|
31
|
+
modeCfg.highlightFormatting = false;
|
32
|
+
|
33
|
+
// Maximum number of nested blockquotes. Set to 0 for infinite nesting.
|
34
|
+
// Excess `>` will emit `error` token.
|
35
|
+
if (modeCfg.maxBlockquoteDepth === undefined)
|
36
|
+
modeCfg.maxBlockquoteDepth = 0;
|
37
|
+
|
38
|
+
// Turn on task lists? ("- [ ] " and "- [x] ")
|
39
|
+
if (modeCfg.taskLists === undefined) modeCfg.taskLists = false;
|
40
|
+
|
41
|
+
// Turn on strikethrough syntax
|
42
|
+
if (modeCfg.strikethrough === undefined)
|
43
|
+
modeCfg.strikethrough = false;
|
44
|
+
|
45
|
+
if (modeCfg.emoji === undefined)
|
46
|
+
modeCfg.emoji = false;
|
47
|
+
|
48
|
+
if (modeCfg.fencedCodeBlockHighlighting === undefined)
|
49
|
+
modeCfg.fencedCodeBlockHighlighting = true;
|
50
|
+
|
51
|
+
if (modeCfg.xml === undefined)
|
52
|
+
modeCfg.xml = true;
|
53
|
+
|
54
|
+
// Allow token types to be overridden by user-provided token types.
|
55
|
+
if (modeCfg.tokenTypeOverrides === undefined)
|
56
|
+
modeCfg.tokenTypeOverrides = {};
|
57
|
+
|
58
|
+
var tokenTypes = {
|
59
|
+
header: "header",
|
60
|
+
code: "comment",
|
61
|
+
quote: "quote",
|
62
|
+
list1: "variable-2",
|
63
|
+
list2: "variable-3",
|
64
|
+
list3: "keyword",
|
65
|
+
hr: "hr",
|
66
|
+
image: "image",
|
67
|
+
imageAltText: "image-alt-text",
|
68
|
+
imageMarker: "image-marker",
|
69
|
+
formatting: "formatting",
|
70
|
+
linkInline: "link",
|
71
|
+
linkEmail: "link",
|
72
|
+
linkText: "link",
|
73
|
+
linkHref: "string",
|
74
|
+
em: "em",
|
75
|
+
strong: "strong",
|
76
|
+
strikethrough: "strikethrough",
|
77
|
+
emoji: "builtin"
|
78
|
+
};
|
79
|
+
|
80
|
+
for (var tokenType in tokenTypes) {
|
81
|
+
if (tokenTypes.hasOwnProperty(tokenType) && modeCfg.tokenTypeOverrides[tokenType]) {
|
82
|
+
tokenTypes[tokenType] = modeCfg.tokenTypeOverrides[tokenType];
|
83
|
+
}
|
84
|
+
}
|
85
|
+
|
86
|
+
var hrRE = /^([*\-_])(?:\s*\1){2,}\s*$/
|
87
|
+
, listRE = /^(?:[*\-+]|^[0-9]+([.)]))\s+/
|
88
|
+
, taskListRE = /^\[(x| )\](?=\s)/i // Must follow listRE
|
89
|
+
, atxHeaderRE = modeCfg.allowAtxHeaderWithoutSpace ? /^(#+)/ : /^(#+)(?: |$)/
|
90
|
+
, setextHeaderRE = /^ *(?:\={1,}|-{1,})\s*$/
|
91
|
+
, textRE = /^[^#!\[\]*_\\<>` "'(~:]+/
|
92
|
+
, fencedCodeRE = /^(~~~+|```+)[ \t]*([\w+#-]*)[^\n`]*$/
|
93
|
+
, linkDefRE = /^\s*\[[^\]]+?\]:\s*\S+(\s*\S*\s*)?$/ // naive link-definition
|
94
|
+
, punctuation = /[!\"#$%&\'()*+,\-\.\/:;<=>?@\[\\\]^_`{|}~—]/
|
95
|
+
, expandedTab = " " // CommonMark specifies tab as 4 spaces
|
96
|
+
|
97
|
+
function switchInline(stream, state, f) {
|
98
|
+
state.f = state.inline = f;
|
99
|
+
return f(stream, state);
|
100
|
+
}
|
101
|
+
|
102
|
+
function switchBlock(stream, state, f) {
|
103
|
+
state.f = state.block = f;
|
104
|
+
return f(stream, state);
|
105
|
+
}
|
106
|
+
|
107
|
+
function lineIsEmpty(line) {
|
108
|
+
return !line || !/\S/.test(line.string)
|
109
|
+
}
|
110
|
+
|
111
|
+
// Blocks
|
112
|
+
|
113
|
+
function blankLine(state) {
|
114
|
+
// Reset linkTitle state
|
115
|
+
state.linkTitle = false;
|
116
|
+
state.linkHref = false;
|
117
|
+
state.linkText = false;
|
118
|
+
// Reset EM state
|
119
|
+
state.em = false;
|
120
|
+
// Reset STRONG state
|
121
|
+
state.strong = false;
|
122
|
+
// Reset strikethrough state
|
123
|
+
state.strikethrough = false;
|
124
|
+
// Reset state.quote
|
125
|
+
state.quote = 0;
|
126
|
+
// Reset state.indentedCode
|
127
|
+
state.indentedCode = false;
|
128
|
+
if (state.f == htmlBlock) {
|
129
|
+
state.f = inlineNormal;
|
130
|
+
state.block = blockNormal;
|
131
|
+
}
|
132
|
+
// Reset state.trailingSpace
|
133
|
+
state.trailingSpace = 0;
|
134
|
+
state.trailingSpaceNewLine = false;
|
135
|
+
// Mark this line as blank
|
136
|
+
state.prevLine = state.thisLine
|
137
|
+
state.thisLine = {stream: null}
|
138
|
+
return null;
|
139
|
+
}
|
140
|
+
|
141
|
+
function blockNormal(stream, state) {
|
142
|
+
var firstTokenOnLine = stream.column() === state.indentation;
|
143
|
+
var prevLineLineIsEmpty = lineIsEmpty(state.prevLine.stream);
|
144
|
+
var prevLineIsIndentedCode = state.indentedCode;
|
145
|
+
var prevLineIsHr = state.prevLine.hr;
|
146
|
+
var prevLineIsList = state.list !== false;
|
147
|
+
var maxNonCodeIndentation = (state.listStack[state.listStack.length - 1] || 0) + 3;
|
148
|
+
|
149
|
+
state.indentedCode = false;
|
150
|
+
|
151
|
+
var lineIndentation = state.indentation;
|
152
|
+
// compute once per line (on first token)
|
153
|
+
if (state.indentationDiff === null) {
|
154
|
+
state.indentationDiff = state.indentation;
|
155
|
+
if (prevLineIsList) {
|
156
|
+
// Reset inline styles which shouldn't propagate aross list items
|
157
|
+
state.em = false;
|
158
|
+
state.strong = false;
|
159
|
+
state.code = false;
|
160
|
+
state.strikethrough = false;
|
161
|
+
|
162
|
+
state.list = null;
|
163
|
+
// While this list item's marker's indentation is less than the deepest
|
164
|
+
// list item's content's indentation,pop the deepest list item
|
165
|
+
// indentation off the stack, and update block indentation state
|
166
|
+
while (lineIndentation < state.listStack[state.listStack.length - 1]) {
|
167
|
+
state.listStack.pop();
|
168
|
+
if (state.listStack.length) {
|
169
|
+
state.indentation = state.listStack[state.listStack.length - 1];
|
170
|
+
// less than the first list's indent -> the line is no longer a list
|
171
|
+
} else {
|
172
|
+
state.list = false;
|
173
|
+
}
|
174
|
+
}
|
175
|
+
if (state.list !== false) {
|
176
|
+
state.indentationDiff = lineIndentation - state.listStack[state.listStack.length - 1]
|
177
|
+
}
|
178
|
+
}
|
179
|
+
}
|
180
|
+
|
181
|
+
// not comprehensive (currently only for setext detection purposes)
|
182
|
+
var allowsInlineContinuation = (
|
183
|
+
!prevLineLineIsEmpty && !prevLineIsHr && !state.prevLine.header &&
|
184
|
+
(!prevLineIsList || !prevLineIsIndentedCode) &&
|
185
|
+
!state.prevLine.fencedCodeEnd
|
186
|
+
);
|
187
|
+
|
188
|
+
var isHr = (state.list === false || prevLineIsHr || prevLineLineIsEmpty) &&
|
189
|
+
state.indentation <= maxNonCodeIndentation && stream.match(hrRE);
|
190
|
+
|
191
|
+
var match = null;
|
192
|
+
if (state.indentationDiff >= 4 && (prevLineIsIndentedCode || state.prevLine.fencedCodeEnd ||
|
193
|
+
state.prevLine.header || prevLineLineIsEmpty)) {
|
194
|
+
stream.skipToEnd();
|
195
|
+
state.indentedCode = true;
|
196
|
+
return tokenTypes.code;
|
197
|
+
} else if (stream.eatSpace()) {
|
198
|
+
return null;
|
199
|
+
} else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(atxHeaderRE)) && match[1].length <= 6) {
|
200
|
+
state.quote = 0;
|
201
|
+
state.header = match[1].length;
|
202
|
+
state.thisLine.header = true;
|
203
|
+
if (modeCfg.highlightFormatting) state.formatting = "header";
|
204
|
+
state.f = state.inline;
|
205
|
+
return getType(state);
|
206
|
+
} else if (state.indentation <= maxNonCodeIndentation && stream.eat('>')) {
|
207
|
+
state.quote = firstTokenOnLine ? 1 : state.quote + 1;
|
208
|
+
if (modeCfg.highlightFormatting) state.formatting = "quote";
|
209
|
+
stream.eatSpace();
|
210
|
+
return getType(state);
|
211
|
+
} else if (!isHr && !state.setext && firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(listRE))) {
|
212
|
+
var listType = match[1] ? "ol" : "ul";
|
213
|
+
|
214
|
+
state.indentation = lineIndentation + stream.current().length;
|
215
|
+
state.list = true;
|
216
|
+
state.quote = 0;
|
217
|
+
|
218
|
+
// Add this list item's content's indentation to the stack
|
219
|
+
state.listStack.push(state.indentation);
|
220
|
+
|
221
|
+
if (modeCfg.taskLists && stream.match(taskListRE, false)) {
|
222
|
+
state.taskList = true;
|
223
|
+
}
|
224
|
+
state.f = state.inline;
|
225
|
+
if (modeCfg.highlightFormatting) state.formatting = ["list", "list-" + listType];
|
226
|
+
return getType(state);
|
227
|
+
} else if (firstTokenOnLine && state.indentation <= maxNonCodeIndentation && (match = stream.match(fencedCodeRE, true))) {
|
228
|
+
state.quote = 0;
|
229
|
+
state.fencedEndRE = new RegExp(match[1] + "+ *$");
|
230
|
+
// try switching mode
|
231
|
+
state.localMode = modeCfg.fencedCodeBlockHighlighting && getMode(match[2]);
|
232
|
+
if (state.localMode) state.localState = CodeMirror.startState(state.localMode);
|
233
|
+
state.f = state.block = local;
|
234
|
+
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
235
|
+
state.code = -1
|
236
|
+
return getType(state);
|
237
|
+
// SETEXT has lowest block-scope precedence after HR, so check it after
|
238
|
+
// the others (code, blockquote, list...)
|
239
|
+
} else if (
|
240
|
+
// if setext set, indicates line after ---/===
|
241
|
+
state.setext || (
|
242
|
+
// line before ---/===
|
243
|
+
(!allowsInlineContinuation || !prevLineIsList) && !state.quote && state.list === false &&
|
244
|
+
!state.code && !isHr && !linkDefRE.test(stream.string) &&
|
245
|
+
(match = stream.lookAhead(1)) && (match = match.match(setextHeaderRE))
|
246
|
+
)
|
247
|
+
) {
|
248
|
+
if ( !state.setext ) {
|
249
|
+
state.header = match[0].charAt(0) == '=' ? 1 : 2;
|
250
|
+
state.setext = state.header;
|
251
|
+
} else {
|
252
|
+
state.header = state.setext;
|
253
|
+
// has no effect on type so we can reset it now
|
254
|
+
state.setext = 0;
|
255
|
+
stream.skipToEnd();
|
256
|
+
if (modeCfg.highlightFormatting) state.formatting = "header";
|
257
|
+
}
|
258
|
+
state.thisLine.header = true;
|
259
|
+
state.f = state.inline;
|
260
|
+
return getType(state);
|
261
|
+
} else if (isHr) {
|
262
|
+
stream.skipToEnd();
|
263
|
+
state.hr = true;
|
264
|
+
state.thisLine.hr = true;
|
265
|
+
return tokenTypes.hr;
|
266
|
+
} else if (stream.peek() === '[') {
|
267
|
+
return switchInline(stream, state, footnoteLink);
|
268
|
+
}
|
269
|
+
|
270
|
+
return switchInline(stream, state, state.inline);
|
271
|
+
}
|
272
|
+
|
273
|
+
function htmlBlock(stream, state) {
|
274
|
+
var style = htmlMode.token(stream, state.htmlState);
|
275
|
+
if (!htmlModeMissing) {
|
276
|
+
var inner = CodeMirror.innerMode(htmlMode, state.htmlState)
|
277
|
+
if ((inner.mode.name == "xml" && inner.state.tagStart === null &&
|
278
|
+
(!inner.state.context && inner.state.tokenize.isInText)) ||
|
279
|
+
(state.md_inside && stream.current().indexOf(">") > -1)) {
|
280
|
+
state.f = inlineNormal;
|
281
|
+
state.block = blockNormal;
|
282
|
+
state.htmlState = null;
|
283
|
+
}
|
284
|
+
}
|
285
|
+
return style;
|
286
|
+
}
|
287
|
+
|
288
|
+
function local(stream, state) {
|
289
|
+
var currListInd = state.listStack[state.listStack.length - 1] || 0;
|
290
|
+
var hasExitedList = state.indentation < currListInd;
|
291
|
+
var maxFencedEndInd = currListInd + 3;
|
292
|
+
if (state.fencedEndRE && state.indentation <= maxFencedEndInd && (hasExitedList || stream.match(state.fencedEndRE))) {
|
293
|
+
if (modeCfg.highlightFormatting) state.formatting = "code-block";
|
294
|
+
var returnType;
|
295
|
+
if (!hasExitedList) returnType = getType(state)
|
296
|
+
state.localMode = state.localState = null;
|
297
|
+
state.block = blockNormal;
|
298
|
+
state.f = inlineNormal;
|
299
|
+
state.fencedEndRE = null;
|
300
|
+
state.code = 0
|
301
|
+
state.thisLine.fencedCodeEnd = true;
|
302
|
+
if (hasExitedList) return switchBlock(stream, state, state.block);
|
303
|
+
return returnType;
|
304
|
+
} else if (state.localMode) {
|
305
|
+
return state.localMode.token(stream, state.localState);
|
306
|
+
} else {
|
307
|
+
stream.skipToEnd();
|
308
|
+
return tokenTypes.code;
|
309
|
+
}
|
310
|
+
}
|
311
|
+
|
312
|
+
// Inline
|
313
|
+
function getType(state) {
|
314
|
+
var styles = [];
|
315
|
+
|
316
|
+
if (state.formatting) {
|
317
|
+
styles.push(tokenTypes.formatting);
|
318
|
+
|
319
|
+
if (typeof state.formatting === "string") state.formatting = [state.formatting];
|
320
|
+
|
321
|
+
for (var i = 0; i < state.formatting.length; i++) {
|
322
|
+
styles.push(tokenTypes.formatting + "-" + state.formatting[i]);
|
323
|
+
|
324
|
+
if (state.formatting[i] === "header") {
|
325
|
+
styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.header);
|
326
|
+
}
|
327
|
+
|
328
|
+
// Add `formatting-quote` and `formatting-quote-#` for blockquotes
|
329
|
+
// Add `error` instead if the maximum blockquote nesting depth is passed
|
330
|
+
if (state.formatting[i] === "quote") {
|
331
|
+
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
|
332
|
+
styles.push(tokenTypes.formatting + "-" + state.formatting[i] + "-" + state.quote);
|
333
|
+
} else {
|
334
|
+
styles.push("error");
|
335
|
+
}
|
336
|
+
}
|
337
|
+
}
|
338
|
+
}
|
339
|
+
|
340
|
+
if (state.taskOpen) {
|
341
|
+
styles.push("meta");
|
342
|
+
return styles.length ? styles.join(' ') : null;
|
343
|
+
}
|
344
|
+
if (state.taskClosed) {
|
345
|
+
styles.push("property");
|
346
|
+
return styles.length ? styles.join(' ') : null;
|
347
|
+
}
|
348
|
+
|
349
|
+
if (state.linkHref) {
|
350
|
+
styles.push(tokenTypes.linkHref, "url");
|
351
|
+
} else { // Only apply inline styles to non-url text
|
352
|
+
if (state.strong) { styles.push(tokenTypes.strong); }
|
353
|
+
if (state.em) { styles.push(tokenTypes.em); }
|
354
|
+
if (state.strikethrough) { styles.push(tokenTypes.strikethrough); }
|
355
|
+
if (state.emoji) { styles.push(tokenTypes.emoji); }
|
356
|
+
if (state.linkText) { styles.push(tokenTypes.linkText); }
|
357
|
+
if (state.code) { styles.push(tokenTypes.code); }
|
358
|
+
if (state.image) { styles.push(tokenTypes.image); }
|
359
|
+
if (state.imageAltText) { styles.push(tokenTypes.imageAltText, "link"); }
|
360
|
+
if (state.imageMarker) { styles.push(tokenTypes.imageMarker); }
|
361
|
+
}
|
362
|
+
|
363
|
+
if (state.header) { styles.push(tokenTypes.header, tokenTypes.header + "-" + state.header); }
|
364
|
+
|
365
|
+
if (state.quote) {
|
366
|
+
styles.push(tokenTypes.quote);
|
367
|
+
|
368
|
+
// Add `quote-#` where the maximum for `#` is modeCfg.maxBlockquoteDepth
|
369
|
+
if (!modeCfg.maxBlockquoteDepth || modeCfg.maxBlockquoteDepth >= state.quote) {
|
370
|
+
styles.push(tokenTypes.quote + "-" + state.quote);
|
371
|
+
} else {
|
372
|
+
styles.push(tokenTypes.quote + "-" + modeCfg.maxBlockquoteDepth);
|
373
|
+
}
|
374
|
+
}
|
375
|
+
|
376
|
+
if (state.list !== false) {
|
377
|
+
var listMod = (state.listStack.length - 1) % 3;
|
378
|
+
if (!listMod) {
|
379
|
+
styles.push(tokenTypes.list1);
|
380
|
+
} else if (listMod === 1) {
|
381
|
+
styles.push(tokenTypes.list2);
|
382
|
+
} else {
|
383
|
+
styles.push(tokenTypes.list3);
|
384
|
+
}
|
385
|
+
}
|
386
|
+
|
387
|
+
if (state.trailingSpaceNewLine) {
|
388
|
+
styles.push("trailing-space-new-line");
|
389
|
+
} else if (state.trailingSpace) {
|
390
|
+
styles.push("trailing-space-" + (state.trailingSpace % 2 ? "a" : "b"));
|
391
|
+
}
|
392
|
+
|
393
|
+
return styles.length ? styles.join(' ') : null;
|
394
|
+
}
|
395
|
+
|
396
|
+
function handleText(stream, state) {
|
397
|
+
if (stream.match(textRE, true)) {
|
398
|
+
return getType(state);
|
399
|
+
}
|
400
|
+
return undefined;
|
401
|
+
}
|
402
|
+
|
403
|
+
function inlineNormal(stream, state) {
|
404
|
+
var style = state.text(stream, state);
|
405
|
+
if (typeof style !== 'undefined')
|
406
|
+
return style;
|
407
|
+
|
408
|
+
if (state.list) { // List marker (*, +, -, 1., etc)
|
409
|
+
state.list = null;
|
410
|
+
return getType(state);
|
411
|
+
}
|
412
|
+
|
413
|
+
if (state.taskList) {
|
414
|
+
var taskOpen = stream.match(taskListRE, true)[1] === " ";
|
415
|
+
if (taskOpen) state.taskOpen = true;
|
416
|
+
else state.taskClosed = true;
|
417
|
+
if (modeCfg.highlightFormatting) state.formatting = "task";
|
418
|
+
state.taskList = false;
|
419
|
+
return getType(state);
|
420
|
+
}
|
421
|
+
|
422
|
+
state.taskOpen = false;
|
423
|
+
state.taskClosed = false;
|
424
|
+
|
425
|
+
if (state.header && stream.match(/^#+$/, true)) {
|
426
|
+
if (modeCfg.highlightFormatting) state.formatting = "header";
|
427
|
+
return getType(state);
|
428
|
+
}
|
429
|
+
|
430
|
+
var ch = stream.next();
|
431
|
+
|
432
|
+
// Matches link titles present on next line
|
433
|
+
if (state.linkTitle) {
|
434
|
+
state.linkTitle = false;
|
435
|
+
var matchCh = ch;
|
436
|
+
if (ch === '(') {
|
437
|
+
matchCh = ')';
|
438
|
+
}
|
439
|
+
matchCh = (matchCh+'').replace(/([.?*+^\[\]\\(){}|-])/g, "\\$1");
|
440
|
+
var regex = '^\\s*(?:[^' + matchCh + '\\\\]+|\\\\\\\\|\\\\.)' + matchCh;
|
441
|
+
if (stream.match(new RegExp(regex), true)) {
|
442
|
+
return tokenTypes.linkHref;
|
443
|
+
}
|
444
|
+
}
|
445
|
+
|
446
|
+
// If this block is changed, it may need to be updated in GFM mode
|
447
|
+
if (ch === '`') {
|
448
|
+
var previousFormatting = state.formatting;
|
449
|
+
if (modeCfg.highlightFormatting) state.formatting = "code";
|
450
|
+
stream.eatWhile('`');
|
451
|
+
var count = stream.current().length
|
452
|
+
if (state.code == 0 && (!state.quote || count == 1)) {
|
453
|
+
state.code = count
|
454
|
+
return getType(state)
|
455
|
+
} else if (count == state.code) { // Must be exact
|
456
|
+
var t = getType(state)
|
457
|
+
state.code = 0
|
458
|
+
return t
|
459
|
+
} else {
|
460
|
+
state.formatting = previousFormatting
|
461
|
+
return getType(state)
|
462
|
+
}
|
463
|
+
} else if (state.code) {
|
464
|
+
return getType(state);
|
465
|
+
}
|
466
|
+
|
467
|
+
if (ch === '\\') {
|
468
|
+
stream.next();
|
469
|
+
if (modeCfg.highlightFormatting) {
|
470
|
+
var type = getType(state);
|
471
|
+
var formattingEscape = tokenTypes.formatting + "-escape";
|
472
|
+
return type ? type + " " + formattingEscape : formattingEscape;
|
473
|
+
}
|
474
|
+
}
|
475
|
+
|
476
|
+
if (ch === '!' && stream.match(/\[[^\]]*\] ?(?:\(|\[)/, false)) {
|
477
|
+
state.imageMarker = true;
|
478
|
+
state.image = true;
|
479
|
+
if (modeCfg.highlightFormatting) state.formatting = "image";
|
480
|
+
return getType(state);
|
481
|
+
}
|
482
|
+
|
483
|
+
if (ch === '[' && state.imageMarker && stream.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/, false)) {
|
484
|
+
state.imageMarker = false;
|
485
|
+
state.imageAltText = true
|
486
|
+
if (modeCfg.highlightFormatting) state.formatting = "image";
|
487
|
+
return getType(state);
|
488
|
+
}
|
489
|
+
|
490
|
+
if (ch === ']' && state.imageAltText) {
|
491
|
+
if (modeCfg.highlightFormatting) state.formatting = "image";
|
492
|
+
var type = getType(state);
|
493
|
+
state.imageAltText = false;
|
494
|
+
state.image = false;
|
495
|
+
state.inline = state.f = linkHref;
|
496
|
+
return type;
|
497
|
+
}
|
498
|
+
|
499
|
+
if (ch === '[' && !state.image) {
|
500
|
+
state.linkText = true;
|
501
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
502
|
+
return getType(state);
|
503
|
+
}
|
504
|
+
|
505
|
+
if (ch === ']' && state.linkText) {
|
506
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
507
|
+
var type = getType(state);
|
508
|
+
state.linkText = false;
|
509
|
+
state.inline = state.f = stream.match(/\(.*?\)| ?\[.*?\]/, false) ? linkHref : inlineNormal
|
510
|
+
return type;
|
511
|
+
}
|
512
|
+
|
513
|
+
if (ch === '<' && stream.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/, false)) {
|
514
|
+
state.f = state.inline = linkInline;
|
515
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
516
|
+
var type = getType(state);
|
517
|
+
if (type){
|
518
|
+
type += " ";
|
519
|
+
} else {
|
520
|
+
type = "";
|
521
|
+
}
|
522
|
+
return type + tokenTypes.linkInline;
|
523
|
+
}
|
524
|
+
|
525
|
+
if (ch === '<' && stream.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/, false)) {
|
526
|
+
state.f = state.inline = linkInline;
|
527
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
528
|
+
var type = getType(state);
|
529
|
+
if (type){
|
530
|
+
type += " ";
|
531
|
+
} else {
|
532
|
+
type = "";
|
533
|
+
}
|
534
|
+
return type + tokenTypes.linkEmail;
|
535
|
+
}
|
536
|
+
|
537
|
+
if (modeCfg.xml && ch === '<' && stream.match(/^(!--|[a-z]+(?:\s+[a-z_:.\-]+(?:\s*=\s*[^ >]+)?)*\s*>)/i, false)) {
|
538
|
+
var end = stream.string.indexOf(">", stream.pos);
|
539
|
+
if (end != -1) {
|
540
|
+
var atts = stream.string.substring(stream.start, end);
|
541
|
+
if (/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(atts)) state.md_inside = true;
|
542
|
+
}
|
543
|
+
stream.backUp(1);
|
544
|
+
state.htmlState = CodeMirror.startState(htmlMode);
|
545
|
+
return switchBlock(stream, state, htmlBlock);
|
546
|
+
}
|
547
|
+
|
548
|
+
if (modeCfg.xml && ch === '<' && stream.match(/^\/\w*?>/)) {
|
549
|
+
state.md_inside = false;
|
550
|
+
return "tag";
|
551
|
+
} else if (ch === "*" || ch === "_") {
|
552
|
+
var len = 1, before = stream.pos == 1 ? " " : stream.string.charAt(stream.pos - 2)
|
553
|
+
while (len < 3 && stream.eat(ch)) len++
|
554
|
+
var after = stream.peek() || " "
|
555
|
+
// See http://spec.commonmark.org/0.27/#emphasis-and-strong-emphasis
|
556
|
+
var leftFlanking = !/\s/.test(after) && (!punctuation.test(after) || /\s/.test(before) || punctuation.test(before))
|
557
|
+
var rightFlanking = !/\s/.test(before) && (!punctuation.test(before) || /\s/.test(after) || punctuation.test(after))
|
558
|
+
var setEm = null, setStrong = null
|
559
|
+
if (len % 2) { // Em
|
560
|
+
if (!state.em && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
|
561
|
+
setEm = true
|
562
|
+
else if (state.em == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
|
563
|
+
setEm = false
|
564
|
+
}
|
565
|
+
if (len > 1) { // Strong
|
566
|
+
if (!state.strong && leftFlanking && (ch === "*" || !rightFlanking || punctuation.test(before)))
|
567
|
+
setStrong = true
|
568
|
+
else if (state.strong == ch && rightFlanking && (ch === "*" || !leftFlanking || punctuation.test(after)))
|
569
|
+
setStrong = false
|
570
|
+
}
|
571
|
+
if (setStrong != null || setEm != null) {
|
572
|
+
if (modeCfg.highlightFormatting) state.formatting = setEm == null ? "strong" : setStrong == null ? "em" : "strong em"
|
573
|
+
if (setEm === true) state.em = ch
|
574
|
+
if (setStrong === true) state.strong = ch
|
575
|
+
var t = getType(state)
|
576
|
+
if (setEm === false) state.em = false
|
577
|
+
if (setStrong === false) state.strong = false
|
578
|
+
return t
|
579
|
+
}
|
580
|
+
} else if (ch === ' ') {
|
581
|
+
if (stream.eat('*') || stream.eat('_')) { // Probably surrounded by spaces
|
582
|
+
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
583
|
+
return getType(state);
|
584
|
+
} else { // Not surrounded by spaces, back up pointer
|
585
|
+
stream.backUp(1);
|
586
|
+
}
|
587
|
+
}
|
588
|
+
}
|
589
|
+
|
590
|
+
if (modeCfg.strikethrough) {
|
591
|
+
if (ch === '~' && stream.eatWhile(ch)) {
|
592
|
+
if (state.strikethrough) {// Remove strikethrough
|
593
|
+
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
|
594
|
+
var t = getType(state);
|
595
|
+
state.strikethrough = false;
|
596
|
+
return t;
|
597
|
+
} else if (stream.match(/^[^\s]/, false)) {// Add strikethrough
|
598
|
+
state.strikethrough = true;
|
599
|
+
if (modeCfg.highlightFormatting) state.formatting = "strikethrough";
|
600
|
+
return getType(state);
|
601
|
+
}
|
602
|
+
} else if (ch === ' ') {
|
603
|
+
if (stream.match(/^~~/, true)) { // Probably surrounded by space
|
604
|
+
if (stream.peek() === ' ') { // Surrounded by spaces, ignore
|
605
|
+
return getType(state);
|
606
|
+
} else { // Not surrounded by spaces, back up pointer
|
607
|
+
stream.backUp(2);
|
608
|
+
}
|
609
|
+
}
|
610
|
+
}
|
611
|
+
}
|
612
|
+
|
613
|
+
if (modeCfg.emoji && ch === ":" && stream.match(/^[a-z_\d+-]+:/)) {
|
614
|
+
state.emoji = true;
|
615
|
+
if (modeCfg.highlightFormatting) state.formatting = "emoji";
|
616
|
+
var retType = getType(state);
|
617
|
+
state.emoji = false;
|
618
|
+
return retType;
|
619
|
+
}
|
620
|
+
|
621
|
+
if (ch === ' ') {
|
622
|
+
if (stream.match(/ +$/, false)) {
|
623
|
+
state.trailingSpace++;
|
624
|
+
} else if (state.trailingSpace) {
|
625
|
+
state.trailingSpaceNewLine = true;
|
626
|
+
}
|
627
|
+
}
|
628
|
+
|
629
|
+
return getType(state);
|
630
|
+
}
|
631
|
+
|
632
|
+
function linkInline(stream, state) {
|
633
|
+
var ch = stream.next();
|
634
|
+
|
635
|
+
if (ch === ">") {
|
636
|
+
state.f = state.inline = inlineNormal;
|
637
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
638
|
+
var type = getType(state);
|
639
|
+
if (type){
|
640
|
+
type += " ";
|
641
|
+
} else {
|
642
|
+
type = "";
|
643
|
+
}
|
644
|
+
return type + tokenTypes.linkInline;
|
645
|
+
}
|
646
|
+
|
647
|
+
stream.match(/^[^>]+/, true);
|
648
|
+
|
649
|
+
return tokenTypes.linkInline;
|
650
|
+
}
|
651
|
+
|
652
|
+
function linkHref(stream, state) {
|
653
|
+
// Check if space, and return NULL if so (to avoid marking the space)
|
654
|
+
if(stream.eatSpace()){
|
655
|
+
return null;
|
656
|
+
}
|
657
|
+
var ch = stream.next();
|
658
|
+
if (ch === '(' || ch === '[') {
|
659
|
+
state.f = state.inline = getLinkHrefInside(ch === "(" ? ")" : "]");
|
660
|
+
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
661
|
+
state.linkHref = true;
|
662
|
+
return getType(state);
|
663
|
+
}
|
664
|
+
return 'error';
|
665
|
+
}
|
666
|
+
|
667
|
+
var linkRE = {
|
668
|
+
")": /^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,
|
669
|
+
"]": /^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/
|
670
|
+
}
|
671
|
+
|
672
|
+
function getLinkHrefInside(endChar) {
|
673
|
+
return function(stream, state) {
|
674
|
+
var ch = stream.next();
|
675
|
+
|
676
|
+
if (ch === endChar) {
|
677
|
+
state.f = state.inline = inlineNormal;
|
678
|
+
if (modeCfg.highlightFormatting) state.formatting = "link-string";
|
679
|
+
var returnState = getType(state);
|
680
|
+
state.linkHref = false;
|
681
|
+
return returnState;
|
682
|
+
}
|
683
|
+
|
684
|
+
stream.match(linkRE[endChar])
|
685
|
+
state.linkHref = true;
|
686
|
+
return getType(state);
|
687
|
+
};
|
688
|
+
}
|
689
|
+
|
690
|
+
function footnoteLink(stream, state) {
|
691
|
+
if (stream.match(/^([^\]\\]|\\.)*\]:/, false)) {
|
692
|
+
state.f = footnoteLinkInside;
|
693
|
+
stream.next(); // Consume [
|
694
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
695
|
+
state.linkText = true;
|
696
|
+
return getType(state);
|
697
|
+
}
|
698
|
+
return switchInline(stream, state, inlineNormal);
|
699
|
+
}
|
700
|
+
|
701
|
+
function footnoteLinkInside(stream, state) {
|
702
|
+
if (stream.match(/^\]:/, true)) {
|
703
|
+
state.f = state.inline = footnoteUrl;
|
704
|
+
if (modeCfg.highlightFormatting) state.formatting = "link";
|
705
|
+
var returnType = getType(state);
|
706
|
+
state.linkText = false;
|
707
|
+
return returnType;
|
708
|
+
}
|
709
|
+
|
710
|
+
stream.match(/^([^\]\\]|\\.)+/, true);
|
711
|
+
|
712
|
+
return tokenTypes.linkText;
|
713
|
+
}
|
714
|
+
|
715
|
+
function footnoteUrl(stream, state) {
|
716
|
+
// Check if space, and return NULL if so (to avoid marking the space)
|
717
|
+
if(stream.eatSpace()){
|
718
|
+
return null;
|
719
|
+
}
|
720
|
+
// Match URL
|
721
|
+
stream.match(/^[^\s]+/, true);
|
722
|
+
// Check for link title
|
723
|
+
if (stream.peek() === undefined) { // End of line, set flag to check next line
|
724
|
+
state.linkTitle = true;
|
725
|
+
} else { // More content on line, check if link title
|
726
|
+
stream.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/, true);
|
727
|
+
}
|
728
|
+
state.f = state.inline = inlineNormal;
|
729
|
+
return tokenTypes.linkHref + " url";
|
730
|
+
}
|
731
|
+
|
732
|
+
var mode = {
|
733
|
+
startState: function() {
|
734
|
+
return {
|
735
|
+
f: blockNormal,
|
736
|
+
|
737
|
+
prevLine: {stream: null},
|
738
|
+
thisLine: {stream: null},
|
739
|
+
|
740
|
+
block: blockNormal,
|
741
|
+
htmlState: null,
|
742
|
+
indentation: 0,
|
743
|
+
|
744
|
+
inline: inlineNormal,
|
745
|
+
text: handleText,
|
746
|
+
|
747
|
+
formatting: false,
|
748
|
+
linkText: false,
|
749
|
+
linkHref: false,
|
750
|
+
linkTitle: false,
|
751
|
+
code: 0,
|
752
|
+
em: false,
|
753
|
+
strong: false,
|
754
|
+
header: 0,
|
755
|
+
setext: 0,
|
756
|
+
hr: false,
|
757
|
+
taskList: false,
|
758
|
+
list: false,
|
759
|
+
listStack: [],
|
760
|
+
quote: 0,
|
761
|
+
trailingSpace: 0,
|
762
|
+
trailingSpaceNewLine: false,
|
763
|
+
strikethrough: false,
|
764
|
+
emoji: false,
|
765
|
+
fencedEndRE: null
|
766
|
+
};
|
767
|
+
},
|
768
|
+
|
769
|
+
copyState: function(s) {
|
770
|
+
return {
|
771
|
+
f: s.f,
|
772
|
+
|
773
|
+
prevLine: s.prevLine,
|
774
|
+
thisLine: s.thisLine,
|
775
|
+
|
776
|
+
block: s.block,
|
777
|
+
htmlState: s.htmlState && CodeMirror.copyState(htmlMode, s.htmlState),
|
778
|
+
indentation: s.indentation,
|
779
|
+
|
780
|
+
localMode: s.localMode,
|
781
|
+
localState: s.localMode ? CodeMirror.copyState(s.localMode, s.localState) : null,
|
782
|
+
|
783
|
+
inline: s.inline,
|
784
|
+
text: s.text,
|
785
|
+
formatting: false,
|
786
|
+
linkText: s.linkText,
|
787
|
+
linkTitle: s.linkTitle,
|
788
|
+
linkHref: s.linkHref,
|
789
|
+
code: s.code,
|
790
|
+
em: s.em,
|
791
|
+
strong: s.strong,
|
792
|
+
strikethrough: s.strikethrough,
|
793
|
+
emoji: s.emoji,
|
794
|
+
header: s.header,
|
795
|
+
setext: s.setext,
|
796
|
+
hr: s.hr,
|
797
|
+
taskList: s.taskList,
|
798
|
+
list: s.list,
|
799
|
+
listStack: s.listStack.slice(0),
|
800
|
+
quote: s.quote,
|
801
|
+
indentedCode: s.indentedCode,
|
802
|
+
trailingSpace: s.trailingSpace,
|
803
|
+
trailingSpaceNewLine: s.trailingSpaceNewLine,
|
804
|
+
md_inside: s.md_inside,
|
805
|
+
fencedEndRE: s.fencedEndRE
|
806
|
+
};
|
807
|
+
},
|
808
|
+
|
809
|
+
token: function(stream, state) {
|
810
|
+
|
811
|
+
// Reset state.formatting
|
812
|
+
state.formatting = false;
|
813
|
+
|
814
|
+
if (stream != state.thisLine.stream) {
|
815
|
+
state.header = 0;
|
816
|
+
state.hr = false;
|
817
|
+
|
818
|
+
if (stream.match(/^\s*$/, true)) {
|
819
|
+
blankLine(state);
|
820
|
+
return null;
|
821
|
+
}
|
822
|
+
|
823
|
+
state.prevLine = state.thisLine
|
824
|
+
state.thisLine = {stream: stream}
|
825
|
+
|
826
|
+
// Reset state.taskList
|
827
|
+
state.taskList = false;
|
828
|
+
|
829
|
+
// Reset state.trailingSpace
|
830
|
+
state.trailingSpace = 0;
|
831
|
+
state.trailingSpaceNewLine = false;
|
832
|
+
|
833
|
+
if (!state.localState) {
|
834
|
+
state.f = state.block;
|
835
|
+
if (state.f != htmlBlock) {
|
836
|
+
var indentation = stream.match(/^\s*/, true)[0].replace(/\t/g, expandedTab).length;
|
837
|
+
state.indentation = indentation;
|
838
|
+
state.indentationDiff = null;
|
839
|
+
if (indentation > 0) return null;
|
840
|
+
}
|
841
|
+
}
|
842
|
+
}
|
843
|
+
return state.f(stream, state);
|
844
|
+
},
|
845
|
+
|
846
|
+
innerMode: function(state) {
|
847
|
+
if (state.block == htmlBlock) return {state: state.htmlState, mode: htmlMode};
|
848
|
+
if (state.localState) return {state: state.localState, mode: state.localMode};
|
849
|
+
return {state: state, mode: mode};
|
850
|
+
},
|
851
|
+
|
852
|
+
indent: function(state, textAfter, line) {
|
853
|
+
if (state.block == htmlBlock && htmlMode.indent) return htmlMode.indent(state.htmlState, textAfter, line)
|
854
|
+
if (state.localState && state.localMode.indent) return state.localMode.indent(state.localState, textAfter, line)
|
855
|
+
return CodeMirror.Pass
|
856
|
+
},
|
857
|
+
|
858
|
+
blankLine: blankLine,
|
859
|
+
|
860
|
+
getType: getType,
|
861
|
+
|
862
|
+
closeBrackets: "()[]{}''\"\"``",
|
863
|
+
fold: "markdown"
|
864
|
+
};
|
865
|
+
return mode;
|
866
|
+
}, "xml");
|
867
|
+
|
868
|
+
CodeMirror.defineMIME("text/markdown", "markdown");
|
869
|
+
|
870
|
+
CodeMirror.defineMIME("text/x-markdown", "markdown");
|
871
|
+
|
872
|
+
});
|