Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
891ea6f6
G
gitlab-foss
项目概览
李少辉-开发者
/
gitlab-foss
通知
15
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
G
gitlab-foss
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
891ea6f6
编写于
1月 27, 2014
作者:
D
Dmitriy Zaporozhets
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Improve highlight for notes
Signed-off-by:
N
Dmitriy Zaporozhets
<
dmitriy.zaporozhets@gmail.com
>
上级
86e4f6e0
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
11 addition
and
14 deletion
+11
-14
app/assets/javascripts/dispatcher.js.coffee
app/assets/javascripts/dispatcher.js.coffee
+1
-1
app/assets/javascripts/notes.js.coffee
app/assets/javascripts/notes.js.coffee
+6
-0
app/assets/stylesheets/generic/highlight.scss
app/assets/stylesheets/generic/highlight.scss
+1
-4
app/assets/stylesheets/main/mixins.scss
app/assets/stylesheets/main/mixins.scss
+1
-1
app/assets/stylesheets/sections/notes.scss
app/assets/stylesheets/sections/notes.scss
+0
-4
lib/redcarpet/render/gitlab_html.rb
lib/redcarpet/render/gitlab_html.rb
+1
-3
spec/helpers/gitlab_markdown_helper_spec.rb
spec/helpers/gitlab_markdown_helper_spec.rb
+1
-1
未找到文件。
app/assets/javascripts/dispatcher.js.coffee
浏览文件 @
891ea6f6
...
...
@@ -56,7 +56,7 @@ class Dispatcher
new
SearchAutocomplete
(
path
,
project_id
,
project_ref
)
initHighlight
:
->
$
(
'pre code'
).
each
(
i
,
e
)
->
$
(
'
.highlight
pre code'
).
each
(
i
,
e
)
->
hljs
.
highlightBlock
(
e
)
$
(
e
).
html
(
$
.
map
(
$
(
e
).
html
().
split
(
"
\n
"
),
(
line
,
i
)
->
"<div class='line' id='LC"
+
(
i
+
1
)
+
"'>"
+
line
+
"</div>"
...
...
app/assets/javascripts/notes.js.coffee
浏览文件 @
891ea6f6
...
...
@@ -94,6 +94,9 @@ class Notes
if
@
isNewNote
(
note
)
@
note_ids
.
push
(
note
.
id
)
$
(
'ul.main-notes-list'
).
append
(
note
.
html
)
code
=
"#note_"
+
note
.
id
+
" .highlight pre code"
$
(
code
).
each
(
i
,
e
)
->
hljs
.
highlightBlock
(
e
)
###
...
...
@@ -253,6 +256,9 @@ class Notes
updateNote
:
(
xhr
,
note
,
status
)
=>
note_li
=
$
(
"#note_"
+
note
.
id
)
note_li
.
replaceWith
(
note
.
html
)
code
=
"#note_"
+
note
.
id
+
" .highlight pre code"
$
(
code
).
each
(
i
,
e
)
->
hljs
.
highlightBlock
(
e
)
###
Called in response to clicking the edit note link
...
...
app/assets/stylesheets/generic/highlight.scss
浏览文件 @
891ea6f6
...
...
@@ -6,6 +6,7 @@
table-layout
:
fixed
;
pre
{
padding
:
10px
;
border
:
none
;
border-radius
:
0
;
font-family
:
$monospace_font
;
...
...
@@ -57,10 +58,6 @@
pre
{
white-space
:
pre
;
word-wrap
:
normal
;
.line
{
padding
:
0
10px
;
}
}
}
}
app/assets/stylesheets/main/mixins.scss
浏览文件 @
891ea6f6
...
...
@@ -128,7 +128,7 @@
}
}
code
{
p
>
code
{
font-size
:
inherit
;
font-weight
:
inherit
;
color
:
#555
;
...
...
app/assets/stylesheets/sections/notes.scss
浏览文件 @
891ea6f6
...
...
@@ -92,10 +92,6 @@ ul.notes {
.note-body
{
@include
md-typography
;
margin-left
:
45px
;
.highlight
{
@include
border-radius
(
4px
);
}
}
.note-header
{
padding-bottom
:
5px
;
...
...
lib/redcarpet/render/gitlab_html.rb
浏览文件 @
891ea6f6
...
...
@@ -23,9 +23,7 @@ class Redcarpet::Render::GitlabHTML < Redcarpet::Render::HTML
<div class="highlighted-data
#{
h
.
user_color_scheme_class
}
">
<div class="highlight">
<pre>
<code class="
#{
language
}
">
#{
code
}
</code>
</pre>
<pre><code class="
#{
language
}
">
#{
code
}
</code></pre>
</div>
</div>
...
...
spec/helpers/gitlab_markdown_helper_spec.rb
浏览文件 @
891ea6f6
...
...
@@ -378,7 +378,7 @@ describe GitlabMarkdownHelper do
it
"should leave code blocks untouched"
do
helper
.
stub
(
:user_color_scheme_class
).
and_return
(
:white
)
target_html
=
"
\n
<div class=
\"
highlighted-data white
\"
>
\n
<div class=
\"
highlight
\"
>
\n
<pre>
\n
<code class=
\"\"
>some code from $
#{
snippet
.
id
}
\n
here too
\n
</code>
\n
</pre>
\n
</div>
\n
</div>
\n\n
"
target_html
=
"
\n
<div class=
\"
highlighted-data white
\"
>
\n
<div class=
\"
highlight
\"
>
\n
<pre>
<code class=
\"\"
>some code from $
#{
snippet
.
id
}
\n
here too
\n
</code>
</pre>
\n
</div>
\n
</div>
\n\n
"
helper
.
markdown
(
"
\n
some code from $
#{
snippet
.
id
}
\n
here too
\n
"
).
should
==
target_html
helper
.
markdown
(
"
\n
```
\n
some code from $
#{
snippet
.
id
}
\n
here too
\n
```
\n
"
).
should
==
target_html
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录