Hi i tried to create a new mode:
CodeMirror.defineMode("mustache", function(config, parserConfig) {
return {
token: function(stream, state) {
// if (stream.match(/\t[\s\S]*(?=\|)/g) ) {
//https://regex101.com/r/rB7pO8/2
//marking all sentences, only the last stays unmarked
if (stream.match(/\t([\S \n\r]*)\|/g) ) {
return "blue";
}
}
};
});
Works fine so far but the regex is just not used correctly. Here is my test online: https://regex101.com/r/rB7pO8/3
The codemirror stream.match will not match the string where ist has \n\r
Any ideas, i mean the regex works outside of codemirror.