Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
李少辉-开发者
gitlab-foss
提交
3fe18525
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,体验更适合开发者的 AI 搜索 >>
提交
3fe18525
编写于
7月 31, 2016
作者:
S
Stan Hu
提交者:
Rémy Coutable
8月 01, 2016
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Trim extra displayed carriage returns in diffs and files with CRLFs
Closes #20440
上级
e91fe755
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
16 addition
and
2 deletion
+16
-2
CHANGELOG
CHANGELOG
+1
-0
lib/rouge/formatters/html_gitlab.rb
lib/rouge/formatters/html_gitlab.rb
+1
-1
spec/lib/gitlab/highlight_spec.rb
spec/lib/gitlab/highlight_spec.rb
+12
-0
spec/support/test_env.rb
spec/support/test_env.rb
+2
-1
未找到文件。
CHANGELOG
浏览文件 @
3fe18525
...
...
@@ -44,6 +44,7 @@ v 8.10.3 (unreleased)
- Properly abort a merge when merge conflicts occur
- Ignore invalid IPs in X-Forwarded-For when trusted proxies are configured.
- Fix Import/Export issue importing milestones and labels not associated properly
- Trim extra displayed carriage returns in diffs and files with CRLFs
v 8.10.2
- User can now search branches by name. !5144
...
...
lib/rouge/formatters/html_gitlab.rb
浏览文件 @
3fe18525
...
...
@@ -18,7 +18,7 @@ module Rouge
is_first
=
false
yield
%(<span id="LC#{@line_number}" class="line">)
line
.
each
{
|
token
,
value
|
yield
span
(
token
,
value
)
}
line
.
each
{
|
token
,
value
|
yield
span
(
token
,
value
.
chomp
)
}
yield
%(</span>)
@line_number
+=
1
...
...
spec/lib/gitlab/highlight_spec.rb
浏览文件 @
3fe18525
...
...
@@ -17,6 +17,18 @@ describe Gitlab::Highlight, lib: true do
expect
(
lines
[
21
]).
to
eq
(
%Q{<span id="LC22" class="line"> <span class="k">unless</span> <span class="no">File</span><span class="p">.</span><span class="nf">directory?</span><span class="p">(</span><span class="n">path</span><span class="p">)</span></span>
\n
}
)
expect
(
lines
[
26
]).
to
eq
(
%Q{<span id="LC27" class="line"> <span class="vi">@cmd_status</span> <span class="o">=</span> <span class="mi">0</span></span>
\n
}
)
end
describe
'with CRLF'
do
let
(
:branch
)
{
'crlf-diff'
}
let
(
:blob
)
{
repository
.
blob_at_branch
(
branch
,
path
)
}
let
(
:lines
)
do
Gitlab
::
Highlight
.
highlight_lines
(
project
.
repository
,
'crlf-diff-test'
,
'files/whitespace'
)
end
it
'strips extra LFs'
do
expect
(
lines
[
0
]).
to
eq
(
"<span id=
\"
LC1
\"
class=
\"
line
\"
>test </span>"
)
end
end
end
describe
'custom highlighting from .gitattributes'
do
...
...
spec/support/test_env.rb
浏览文件 @
3fe18525
...
...
@@ -21,7 +21,8 @@ module TestEnv
'expand-collapse-diffs'
=>
'4842455'
,
'expand-collapse-files'
=>
'025db92'
,
'expand-collapse-lines'
=>
'238e82d'
,
'video'
=>
'8879059'
'video'
=>
'8879059'
,
'crlf-diff'
=>
'5938907'
}
# gitlab-test-fork is a fork of gitlab-fork, but we don't necessarily
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录