Tweaked ace mode

This commit is contained in:
benweet 2013-11-18 23:11:05 +00:00
parent 909b0dcde1
commit 239d378f2d
6 changed files with 28 additions and 22 deletions

View File

@ -59,7 +59,7 @@ define([
}
var token = tokens.shift();
var words = [];
if (!/code|code_block|reference|markup\.underline/.test(token.type)) {
if (!/code|code_block|link|reference|string|keyword|tag|markup\.underline/.test(token.type)) {
token.value.replace(wordRegExp, function(word, offset) {
words.push({
value: word,

View File

@ -81,8 +81,8 @@ var MarkdownHighlightRules = function() {
regex : "\\$\\$|\\\\\\\\\\[|\\\\\\\\\\\\\\\\\\(",
next : "mathblock"
}, { // LaTeX block
token : "keyword",
regex : "\\\\?\\\\begin\\{[a-z]*\\*?\\}",
token : ["keyword", "text"],
regex : "(\\\\?\\\\begin)(\\{[a-z]*\\*?\\})",
next : "latexblock"
}, {
include : "basic"
@ -96,13 +96,13 @@ var MarkdownHighlightRules = function() {
token : "code",
regex : "(`+)(.*?[^`])(\\1)"
}, { // reference
token : ["text", "reference", "text", "markup.underline", "description", "text"],
token : ["text", "reference", "text", "link", "description", "text"],
regex : "^([ ]{0,3}\\[)([^\\]]+)(\\]:\\s*)([^ ]+)(\\s*(?:[\"][^\"]+[\"])?(\\s*))$"
}, { // link by reference
token : ["text", "description", "text", "markup.underline", "text"],
token : ["text", "markup.underline", "text", "reference", "text"],
regex : "(\\[)((?:[[^\\]]*\\]|[^\\[\\]])*)(\\][ ]?(?:\\n[ ]*)?\\[)(.*?)(\\])"
}, { // link by url
token : ["text", "description", "text", "markup.underline", "string", "text"],
token : ["text", "markup.underline", "text", "link", "description", "text"],
regex : "(\\[)"+
"(\\[[^\\]]*\\]|[^\\[\\]]*)"+
"(\\]\\([ \\t]*)"+
@ -186,8 +186,8 @@ var MarkdownHighlightRules = function() {
} ],
"latexblock" : [{
token : "keyword",
regex : "\\\\?\\\\end\\{[a-z]*\\*?\\}",
token : ["keyword", "text"],
regex : "(\\\\?\\\\end)(\\{[a-z]*\\*?\\})",
next : "start"
}, {
include : "latex"

View File

@ -16,8 +16,8 @@ define([
var result;
_.find(doc.thumbnails, function(thumbnail) {
var found = false;
thumbnail.url.replace(/(.*\/s)\d.*?(\/[^\/]+)/, function(match, sub1, sub2) {
result = sub1 + size + sub2;
thumbnail.url.replace(/^(.*[\/=]s)\d.*?(\/[^\/]+)?$/, function(match, sub1, sub2) {
result = sub1 + size + (sub2 || '');
found = true;
});
return found;

View File

@ -18,9 +18,9 @@
@secondary-bg-light: lighten(@secondary-bg, 7%);
@secondary-bg-dark: darken(@secondary-bg, 7%);
@primary-color: #333;
@primary-color-light: lighten(@primary-color, 13%);
@primary-color-lighter: lighten(@primary-color, 20%);
@primary-color-lightest: lighten(@primary-color, 35%);
@primary-color-light: lighten(@primary-color, 12.5%);
@primary-color-lighter: lighten(@primary-color, 25%);
@primary-color-lightest: lighten(@primary-color, 37.5%);
@primary-color-inv: #fff;
@bg-navbar-hover: @primary-bg-lighter;
@error-border: #ff8661;
@ -972,7 +972,7 @@ ul,ol {
*****************************/
.ace_editor {
color: @primary-color-light;
color: @primary-color-lighter;
}
.ace-tm {
@ -996,7 +996,7 @@ ul,ol {
}
.ace_markup.ace_list {
color: @primary-color-lightest;
color: @primary-color;
}
.ace_constant.ace_language {
@ -1051,13 +1051,18 @@ ul,ol {
}
.ace_description {
color: @primary-color-lighter;
color: @primary-color-lightest;
}
.ace_constant {
color: @primary-color-light;
}
.ace_comment {
color: fade(@primary-color-lighter, 50%);
font-style: italic;
}
.ace_marker-layer .misspelled {
position: absolute;
z-index: -2;

View File

@ -8,9 +8,9 @@
@secondary-bg-light: darken(@secondary-bg, 7%);
@secondary-bg-dark: lighten(@secondary-bg, 7%);
@primary-color: #fff;
@primary-color-light: darken(@primary-color, 13%);
@primary-color-lighter: darken(@primary-color, 20%);
@primary-color-lightest: darken(@primary-color, 35%);
@primary-color-light: darken(@primary-color, 12.5%);
@primary-color-lighter: darken(@primary-color, 25%);
@primary-color-lightest: darken(@primary-color, 37.5%);
@primary-color-inv: #fff;
@disabled-color: #999;
@panel-button-color: #777;

View File

@ -9,9 +9,6 @@
@navbar-default-bg: darken(@board-color, 2%);
@bg-navbar-hover: lighten(@board-color, 4%);
@primary-color: @blue-ink;
@primary-color-light: lighten(@primary-color, 13%);
@primary-color-lighter: lighten(@primary-color, 20%);
@primary-color-lightest: lighten(@primary-color, 35%);
@primary-bg: lighten(@board-border-color, 16%);
@primary-bg-light: lighten(@board-border-color, 20%);
@primary-bg-lighter: lighten(@board-border-color, 24%);
@ -77,6 +74,10 @@
.ace_code_block {
color: @green-ink;
}
.ace_comment {
color: @green-ink;
}
}
h1, h2, h3, h4, h5, h6 {