From e19899962edfa9005e1f8fdbc56b1c8e7982864c Mon Sep 17 00:00:00 2001 From: syuilo Date: Sun, 12 Feb 2017 02:38:47 +0900 Subject: インラインのコードでもシンタックスハイライトを有効化 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/web/app/base.styl | 72 ++++++++++++++--------------- src/web/app/common/scripts/text-compiler.js | 4 +- 2 files changed, 38 insertions(+), 38 deletions(-) (limited to 'src/web/app') diff --git a/src/web/app/base.styl b/src/web/app/base.styl index 334ef91f76..c35f66c9a5 100644 --- a/src/web/app/base.styl +++ b/src/web/app/base.styl @@ -110,54 +110,54 @@ a code font-family Consolas, 'Courier New', Courier, Monaco, monospace -pre - display block + .comment + opacity 0.5 - > code - display block - overflow auto - tab-size 2 + .string + color #e96900 - .comment - opacity 0.5 + .regexp + color #e9003f - .string - color #e96900 + .keyword + color #2973b7 - .regexp - color #e9003f + &.true + &.false + &.null + &.nil + &.undefined + color #ae81ff - .keyword - color #2973b7 + .symbol + color #42b983 - &.true - &.false - &.null - &.nil - &.undefined - color #ae81ff + .number + .nan + color #ae81ff - .symbol - color #42b983 + .var:not(.keyword) + font-weight bold + font-style italic + //text-decoration underline - .number - .nan - color #ae81ff + .method + font-style italic + color #8964c1 - .var:not(.keyword) - font-weight bold - font-style italic - //text-decoration underline + .property + color #a71d5d - .method - font-style italic - color #8964c1 + .label + color #e9003f - .property - color #a71d5d +pre + display block - .label - color #e9003f + > code + display block + overflow auto + tab-size 2 mk-locker display block diff --git a/src/web/app/common/scripts/text-compiler.js b/src/web/app/common/scripts/text-compiler.js index f47ce0f3c3..62e70463ad 100644 --- a/src/web/app/common/scripts/text-compiler.js +++ b/src/web/app/common/scripts/text-compiler.js @@ -31,9 +31,9 @@ module.exports = function(tokens, shouldBreak, shouldEscape) { case 'hashtag': // TODO return '' + escape(token.content) + ''; case 'code': - return '
' + token.codeHtml + '
'; + return '
' + token.html + '
'; case 'inline-code': - return '' + escape(token.code) + ''; + return '' + token.html + ''; } }).join(''); -- cgit v1.2.3-freya