1234567891011121314151617181920212223242526272829303132333435363738394041 |
- (function(mod) {
- if (typeof exports == "object" && typeof module == "object")
- mod(require("../../lib/codemirror"));
- else if (typeof define == "function" && define.amd)
- define(["../../lib/codemirror"], mod);
- else
- mod(CodeMirror);
- })(function(CodeMirror) {
- "use strict";
- CodeMirror.registerHelper("lint", "yaml", function(text) {
- var found = [];
- if (!window.jsyaml) {
- if (window.console) {
- window.console.error("Error: window.jsyaml not defined, CodeMirror YAML linting cannot run.");
- }
- return found;
- }
- try { jsyaml.loadAll(text); }
- catch(e) {
- var loc = e.mark,
-
-
-
-
-
- from = loc ? CodeMirror.Pos(loc.line, loc.column) : CodeMirror.Pos(0, 0),
- to = from;
- found.push({ from: from, to: to, message: e.message });
- }
- return found;
- });
- });
|