From 1ba09e1a8449c091a8c1d46e775521aa7070032c Mon Sep 17 00:00:00 2001 From: nightwing Date: Sat, 23 Feb 2013 13:09:14 +0400 Subject: [PATCH] fix * highlighting in markdown lists --- lib/ace/mode/_test/text_markdown.txt | 2 ++ lib/ace/mode/_test/tokens_markdown.json | 10 ++++++++++ lib/ace/mode/markdown_highlight_rules.js | 4 ++-- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/lib/ace/mode/_test/text_markdown.txt b/lib/ace/mode/_test/text_markdown.txt index f3c044c6..ecaa01b9 100644 --- a/lib/ace/mode/_test/text_markdown.txt +++ b/lib/ace/mode/_test/text_markdown.txt @@ -9,11 +9,13 @@ test: header ends with '#' test: 6+ #s is not a valid header ####### foo test: # followed be only space is not a valid header +# test: only space between #s is not a valid header # # # test links [Cloud9 IDE](http://www.c9.io/) # * [demo](http://ajaxorg.github.com/ace/) +* usually *work* fine (_em_) in lists in plain text http://ace.ajaxorg.com diff --git a/lib/ace/mode/_test/tokens_markdown.json b/lib/ace/mode/_test/tokens_markdown.json index 63a9650e..91f7f992 100644 --- a/lib/ace/mode/_test/tokens_markdown.json +++ b/lib/ace/mode/_test/tokens_markdown.json @@ -35,6 +35,9 @@ ],[ "start", ["text","test: # followed be only space is not a valid header"] +],[ + "start", + ["text","# "] ],[ "start", ["text","test: only space between #s is not a valid header"] @@ -62,6 +65,13 @@ ["markup.underline","http://ajaxorg.github.com/ace/"], ["text",")"], ["markup.list"," "] +],[ + "listblock", + ["markup.list","* usually "], + ["string","*work*"], + ["markup.list"," fine ("], + ["string","_em_"], + ["markup.list",")"] ],[ "listblock", ["markup.list","in lists"] diff --git a/lib/ace/mode/markdown_highlight_rules.js b/lib/ace/mode/markdown_highlight_rules.js index 39b95fc8..97d3c182 100644 --- a/lib/ace/mode/markdown_highlight_rules.js +++ b/lib/ace/mode/markdown_highlight_rules.js @@ -150,12 +150,12 @@ var MarkdownHighlightRules = function() { token : "empty_line", regex : "^$", next : "start" - }, { - include : "basic", noEscape: true }, { // list token : "markup.list", regex : "^\\s{0,3}(?:[*+-]|\\d+\\.)\\s+", next : "listblock-start" + }, { + include : "basic", noEscape: true }, { defaultToken : "markup.list" } ],