function splitSnippet()

in lib/filters/snippets.js [14:27]


function splitSnippet(data) {
  var regex = /\/\/DOC-START([\s\S]*?)\/\/DOC-END/g

  if (data.indexOf("//DOC-START") != -1 && data.indexOf("//DOC-END") != -1) {
    var matches;
    var codeSnippets = [];
    while (matches = regex.exec(data)) {
      codeSnippets.push(matches[1]);
    }
    return codeSnippets.join("\n");
  } else {
    return data;
  }
}