Code Duplication    Length = 32-34 lines in 2 locations

Resources/Public/JavaScript/editormd/lib/codemirror/mode/julia/julia.js 1 location

@@ 214-247 (lines=34) @@
211
    return ERRORCLASS;
212
  }
213
214
  function tokenStringFactory(delimiter) {
215
    while ('rub'.indexOf(delimiter.charAt(0).toLowerCase()) >= 0) {
216
      delimiter = delimiter.substr(1);
217
    }
218
    var singleline = delimiter.length == 1;
219
    var OUTCLASS = 'string';
220
221
    function tokenString(stream, state) {
222
      while (!stream.eol()) {
223
        stream.eatWhile(/[^'"\\]/);
224
        if (stream.eat('\\')) {
225
            stream.next();
226
            if (singleline && stream.eol()) {
227
              return OUTCLASS;
228
            }
229
        } else if (stream.match(delimiter)) {
230
            state.tokenize = tokenBase;
231
            return OUTCLASS;
232
        } else {
233
            stream.eat(/['"]/);
234
        }
235
      }
236
      if (singleline) {
237
        if (parserConf.singleLineStringErrors) {
238
            return ERRORCLASS;
239
        } else {
240
            state.tokenize = tokenBase;
241
        }
242
      }
243
      return OUTCLASS;
244
    }
245
    tokenString.isString = true;
246
    return tokenString;
247
  }
248
249
  function tokenLexer(stream, state) {
250
    indentInfo = null;

Resources/Public/JavaScript/editormd/lib/codemirror/mode/python/python.js 1 location

@@ 193-224 (lines=32) @@
190
      return ERRORCLASS;
191
    }
192
193
    function tokenStringFactory(delimiter) {
194
      while ("rub".indexOf(delimiter.charAt(0).toLowerCase()) >= 0)
195
        delimiter = delimiter.substr(1);
196
197
      var singleline = delimiter.length == 1;
198
      var OUTCLASS = "string";
199
200
      function tokenString(stream, state) {
201
        while (!stream.eol()) {
202
          stream.eatWhile(/[^'"\\]/);
203
          if (stream.eat("\\")) {
204
            stream.next();
205
            if (singleline && stream.eol())
206
              return OUTCLASS;
207
          } else if (stream.match(delimiter)) {
208
            state.tokenize = tokenBase;
209
            return OUTCLASS;
210
          } else {
211
            stream.eat(/['"]/);
212
          }
213
        }
214
        if (singleline) {
215
          if (parserConf.singleLineStringErrors)
216
            return ERRORCLASS;
217
          else
218
            state.tokenize = tokenBase;
219
        }
220
        return OUTCLASS;
221
      }
222
      tokenString.isString = true;
223
      return tokenString;
224
    }
225
226
    function pushScope(stream, state, type) {
227
      var offset = 0, align = null;