diff --git a/mode/cobol/cobol.js b/mode/cobol/cobol.js
index <HASH>..<HASH> 100644
--- a/mode/cobol/cobol.js
+++ b/mode/cobol/cobol.js
@@ -195,7 +195,7 @@ CodeMirror.defineMode("cobol", function () {
       case "string": // multi-line string parsing mode
         var next = false;
         while ((next = stream.next()) != null) {
-          if (next == "\"" || next == "\'") {
+          if ((next == "\"" || next == "\'") && !stream.match(/['"]/, false)) {
             state.mode = false;
             break;
           }
[cobol mode] Highlight single or double quote inside single quotes as closed string