summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGrant Gayed <grant_gayed@ca.ibm.com>2014-10-21 15:37:00 -0400
committerGrant Gayed <grant_gayed@ca.ibm.com>2014-10-21 15:37:00 -0400
commit56f9b518c9f237810aa716cc2823508d83addd5c (patch)
treed096b486aca06341b65f111e2c49e4706d3a6880
parentef19b180e9de53c0f9e094e77acec6be65662011 (diff)
downloadorg.eclipse.orion.client-origin/bug448140.zip
org.eclipse.orion.client-origin/bug448140.tar.gz
org.eclipse.orion.client-origin/bug448140.tar.bz2
Bug 448140 - markdown editor shows invalid warning for ordered list in blockquoteorigin/bug448140
-rw-r--r--bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js13
1 files changed, 7 insertions, 6 deletions
diff --git a/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js b/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js
index 86b0635..844e4ee 100644
--- a/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js
+++ b/bundles/org.eclipse.orion.client.ui/web/orion/markdownEditor.js
@@ -252,11 +252,9 @@ define([
if (tokens[i].type === "blockquote_start") { //$NON-NLS-0$
endToken = "blockquote_end"; //$NON-NLS-0$
- var contentStartRegex = this._blockquoteStartRegex;
name = "markup.quote.markdown"; //$NON-NLS-0$
} else { /* list_start */
endToken = "list_end"; //$NON-NLS-0$
- contentStartRegex = null;
name = "markup.list.markdown"; //$NON-NLS-0$
}
@@ -284,7 +282,6 @@ define([
match = this._newlineRegex.exec(text);
if (match) {
index = match.index + match[0].length;
-
if (name === "markup.list.markdown") { //$NON-NLS-0$
/* for lists claim whitespace that starts the next line */
this._spacesAndTabsRegex.lastIndex = index;
@@ -296,11 +293,15 @@ define([
}
/* compute the block's contentStart bound */
- if (contentStartRegex) {
- contentStartRegex.lastIndex = start;
- match = contentStartRegex.exec(text);
+ if (name === "markup.quote.markdown") { //$NON-NLS-0$
+ this._blockquoteStartRegex.lastIndex = start;
+ match = this._blockquoteStartRegex.exec(text);
var contentStart = start + match[0].length;
} else {
+ /* marked.Lexer.rules.normal.bullet is not global, so cannot set its lastIndex */
+ var tempText = text.substring(start);
+ match = marked.Lexer.rules.normal.bullet.exec(tempText);
+ start += match.index;
contentStart = start;
}
index = Math.max(index, contentStart);