Merge branch 'fix-markdown-highlighting'
This commit is contained in:
commit
fbc5460320
1 changed files with 12 additions and 8 deletions
|
|
@ -46,7 +46,7 @@ var escaped = function(ch) {
|
||||||
function github_embed(tag, prefix) {
|
function github_embed(tag, prefix) {
|
||||||
return { // Github style block
|
return { // Github style block
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```" + tag + "\\s*$",
|
regex : "^\\s*```" + tag + "\\s*$",
|
||||||
push : prefix + "start"
|
push : prefix + "start"
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -79,7 +79,7 @@ var MarkdownHighlightRules = function() {
|
||||||
github_embed("css", "csscode-"),
|
github_embed("css", "csscode-"),
|
||||||
{ // Github style block
|
{ // Github style block
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```\\s*\\S*(?:{.*?\\})?\\s*$",
|
regex : "^\\s*```\\s*\\S*(?:{.*?\\})?\\s*$",
|
||||||
next : "githubblock"
|
next : "githubblock"
|
||||||
}, { // block quote
|
}, { // block quote
|
||||||
token : "string.blockquote",
|
token : "string.blockquote",
|
||||||
|
|
@ -164,11 +164,15 @@ var MarkdownHighlightRules = function() {
|
||||||
next : "listblock-start"
|
next : "listblock-start"
|
||||||
}, {
|
}, {
|
||||||
include : "basic", noEscape: true
|
include : "basic", noEscape: true
|
||||||
|
}, { // Github style block
|
||||||
|
token : "support.function",
|
||||||
|
regex : "^\\s*```\\s*[a-zA-Z]*(?:{.*?\\})?\\s*$",
|
||||||
|
next : "githubblock"
|
||||||
}, {
|
}, {
|
||||||
defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
|
defaultToken : "list" //do not use markup.list to allow stling leading `*` differntly
|
||||||
} ],
|
} ],
|
||||||
|
|
||||||
"blockquote" : [ { // BLockquotes only escape on blank lines.
|
"blockquote" : [ { // Blockquotes only escape on blank lines.
|
||||||
token : "empty_line",
|
token : "empty_line",
|
||||||
regex : "^\\s*$",
|
regex : "^\\s*$",
|
||||||
next : "start"
|
next : "start"
|
||||||
|
|
@ -184,7 +188,7 @@ var MarkdownHighlightRules = function() {
|
||||||
|
|
||||||
"githubblock" : [ {
|
"githubblock" : [ {
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```",
|
regex : "^\\s*```",
|
||||||
next : "start"
|
next : "start"
|
||||||
}, {
|
}, {
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
|
|
@ -194,25 +198,25 @@ var MarkdownHighlightRules = function() {
|
||||||
|
|
||||||
this.embedRules(JavaScriptHighlightRules, "jscode-", [{
|
this.embedRules(JavaScriptHighlightRules, "jscode-", [{
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```",
|
regex : "^\\s*```",
|
||||||
next : "pop"
|
next : "pop"
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
this.embedRules(HtmlHighlightRules, "htmlcode-", [{
|
this.embedRules(HtmlHighlightRules, "htmlcode-", [{
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```",
|
regex : "^\\s*```",
|
||||||
next : "pop"
|
next : "pop"
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
this.embedRules(CssHighlightRules, "csscode-", [{
|
this.embedRules(CssHighlightRules, "csscode-", [{
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```",
|
regex : "^\\s*```",
|
||||||
next : "pop"
|
next : "pop"
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
this.embedRules(XmlHighlightRules, "xmlcode-", [{
|
this.embedRules(XmlHighlightRules, "xmlcode-", [{
|
||||||
token : "support.function",
|
token : "support.function",
|
||||||
regex : "^```",
|
regex : "^\\s*```",
|
||||||
next : "pop"
|
next : "pop"
|
||||||
}]);
|
}]);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue