インラインのコードでもシンタックスハイライトを有効化

This commit is contained in:
syuilo
2017-02-12 02:38:47 +09:00
parent 7791dd5471
commit e19899962e
5 changed files with 382 additions and 378 deletions

View File

@ -110,6 +110,47 @@ a
code
font-family Consolas, 'Courier New', Courier, Monaco, monospace
.comment
opacity 0.5
.string
color #e96900
.regexp
color #e9003f
.keyword
color #2973b7
&.true
&.false
&.null
&.nil
&.undefined
color #ae81ff
.symbol
color #42b983
.number
.nan
color #ae81ff
.var:not(.keyword)
font-weight bold
font-style italic
//text-decoration underline
.method
font-style italic
color #8964c1
.property
color #a71d5d
.label
color #e9003f
pre
display block
@ -118,47 +159,6 @@ pre
overflow auto
tab-size 2
.comment
opacity 0.5
.string
color #e96900
.regexp
color #e9003f
.keyword
color #2973b7
&.true
&.false
&.null
&.nil
&.undefined
color #ae81ff
.symbol
color #42b983
.number
.nan
color #ae81ff
.var:not(.keyword)
font-weight bold
font-style italic
//text-decoration underline
.method
font-style italic
color #8964c1
.property
color #a71d5d
.label
color #e9003f
mk-locker
display block
position fixed

View File

@ -31,9 +31,9 @@ module.exports = function(tokens, shouldBreak, shouldEscape) {
case 'hashtag': // TODO
return '<a>' + escape(token.content) + '</a>';
case 'code':
return '<pre><code>' + token.codeHtml + '</code></pre>';
return '<pre><code>' + token.html + '</code></pre>';
case 'inline-code':
return '<code>' + escape(token.code) + '</code>';
return '<code>' + token.html + '</code>';
}
}).join('');