public/javascripts/erp_app/codemirror/mode/rst/rst.js in erp_app-3.0.7 vs public/javascripts/erp_app/codemirror/mode/rst/rst.js in erp_app-3.0.8

- old
+ new

@@ -71,22 +71,21 @@ if (sol && (ch = stream.eat(reSection))) { for (i = 0; stream.eat(ch); i++); if (i >= 3 && stream.match(/^\s*$/)) { setNormal(state, null); - return 'section'; + return 'header'; } else { stream.backUp(i + 1); } } if (sol && stream.match(reDirectiveMarker)) { if (!stream.eol()) { setState(state, directive); } - - return 'directive-marker'; + return 'meta'; } if (stream.match(reVerbatimMarker)) { if (!verbatimMode) { setState(state, verbatim); @@ -96,18 +95,17 @@ setState(state, verbatim, { mode: mode, local: mode.startState() }); } - - return 'verbatim-marker'; + return 'meta'; } if (sol && stream.match(reExamples, false)) { if (!pythonMode) { setState(state, verbatim); - return 'verbatim-marker'; + return 'meta'; } else { var mode = pythonMode; setState(state, verbatim, { mode: mode, @@ -116,16 +114,10 @@ return null; } } - if (sol && (stream.match(reEnumeratedList) || - stream.match(reBulletedList))) { - setNormal(state, stream); - return 'list'; - } - function testBackward(re) { return sol || !state.ctx.back || re.test(state.ctx.back); } function testForward(re) { @@ -151,13 +143,13 @@ if (testBackward(rePreInline)) { if ((ch === ':' || ch === '|') && stream.eat(/\S/)) { var token; if (ch === ':') { - token = 'role'; + token = 'builtin'; } else { - token = 'replacement'; + token = 'atom'; } setState(state, inline, { ch: ch, wide: false, @@ -181,13 +173,13 @@ if (ch && !/\s/.test(ch)) { var token; if (orig === '*') { - token = wide ? 'strong' : 'emphasis'; + token = wide ? 'strong' : 'em'; } else { - token = wide ? 'inline' : 'interpreted'; + token = wide ? 'string' : 'string-2'; } setState(state, inline, { ch: orig, // inline() has to know what to search for wide: wide, // are we looking for `ch` or `chch` @@ -245,17 +237,17 @@ function directive(stream, state) { var token = null; if (stream.match(reDirective)) { - token = 'directive'; + token = 'attribute'; } else if (stream.match(reHyperlink)) { - token = 'hyperlink'; + token = 'link'; } else if (stream.match(reFootnote)) { - token = 'footnote'; + token = 'quote'; } else if (stream.match(reCitation)) { - token = 'citation'; + token = 'quote'; } else { stream.eatSpace(); if (stream.eol()) { setNormal(state, stream); @@ -265,10 +257,11 @@ setState(state, comment); return 'comment'; } } + // FIXME this is unreachable setState(state, body, {start: true}); return token; } function body(stream, state) { @@ -288,11 +281,11 @@ return block(stream, state, 'comment'); } function verbatim(stream, state) { if (!verbatimMode) { - return block(stream, state, 'verbatim'); + return block(stream, state, 'meta'); } else { if (stream.sol()) { if (!stream.eatSpace()) { setNormal(state, stream); } @@ -326,8 +319,8 @@ token: function(stream, state) { var token = state.fn(stream, state); return token; } }; -}); +}, "python"); CodeMirror.defineMIME("text/x-rst", "rst");