LaravelTest
77 строк · 2.8 Кб
1// CodeMirror, copyright (c) by Marijn Haverbeke and others
2// Distributed under an MIT license: https://codemirror.net/LICENSE
3
4(function (mod) {5"use strict";6if (typeof exports === "object" && typeof module === "object") {// CommonJS7mod(require("../../lib/codemirror"),8require("../../addon/mode/overlay"),9require("../xml/xml"),10require("../javascript/javascript"),11require("../coffeescript/coffeescript"),12require("../css/css"),13require("../sass/sass"),14require("../stylus/stylus"),15require("../pug/pug"),16require("../handlebars/handlebars"));17} else if (typeof define === "function" && define.amd) { // AMD18define(["../../lib/codemirror",19"../../addon/mode/overlay",20"../xml/xml",21"../javascript/javascript",22"../coffeescript/coffeescript",23"../css/css",24"../sass/sass",25"../stylus/stylus",26"../pug/pug",27"../handlebars/handlebars"], mod);28} else { // Plain browser env29mod(CodeMirror);30}31})(function (CodeMirror) {32var tagLanguages = {33script: [34["lang", /coffee(script)?/, "coffeescript"],35["type", /^(?:text|application)\/(?:x-)?coffee(?:script)?$/, "coffeescript"],36["lang", /^babel$/, "javascript"],37["type", /^text\/babel$/, "javascript"],38["type", /^text\/ecmascript-\d+$/, "javascript"]39],40style: [41["lang", /^stylus$/i, "stylus"],42["lang", /^sass$/i, "sass"],43["lang", /^less$/i, "text/x-less"],44["lang", /^scss$/i, "text/x-scss"],45["type", /^(text\/)?(x-)?styl(us)?$/i, "stylus"],46["type", /^text\/sass/i, "sass"],47["type", /^(text\/)?(x-)?scss$/i, "text/x-scss"],48["type", /^(text\/)?(x-)?less$/i, "text/x-less"]49],50template: [51["lang", /^vue-template$/i, "vue"],52["lang", /^pug$/i, "pug"],53["lang", /^handlebars$/i, "handlebars"],54["type", /^(text\/)?(x-)?pug$/i, "pug"],55["type", /^text\/x-handlebars-template$/i, "handlebars"],56[null, null, "vue-template"]57]58};59
60CodeMirror.defineMode("vue-template", function (config, parserConfig) {61var mustacheOverlay = {62token: function (stream) {63if (stream.match(/^\{\{.*?\}\}/)) return "meta mustache";64while (stream.next() && !stream.match("{{", false)) {}65return null;66}67};68return CodeMirror.overlayMode(CodeMirror.getMode(config, parserConfig.backdrop || "text/html"), mustacheOverlay);69});70
71CodeMirror.defineMode("vue", function (config) {72return CodeMirror.getMode(config, {name: "htmlmixed", tags: tagLanguages});73}, "htmlmixed", "xml", "javascript", "coffeescript", "css", "sass", "stylus", "pug", "handlebars");74
75CodeMirror.defineMIME("script/x-vue", "vue");76CodeMirror.defineMIME("text/x-vue", "vue");77});78