Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
coopwire-hypothesis
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
孙灵跃 Leon Sun
coopwire-hypothesis
Commits
9ca30be0
Commit
9ca30be0
authored
Oct 07, 2015
by
Sean Hammond
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Replace %20 with space when displaying filenames
parent
ef9655d6
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
2 deletions
+11
-2
document-domain.js
h/static/scripts/filter/document-domain.js
+2
-2
document-domain-test.js
h/static/scripts/filter/test/document-domain-test.js
+9
-0
No files found.
h/static/scripts/filter/document-domain.js
View file @
9ca30be0
...
@@ -21,12 +21,12 @@ module.exports = function() {
...
@@ -21,12 +21,12 @@ module.exports = function() {
var
parts
=
uri
.
split
(
'/'
);
var
parts
=
uri
.
split
(
'/'
);
var
filename
=
parts
[
parts
.
length
-
1
];
var
filename
=
parts
[
parts
.
length
-
1
];
if
(
filename
)
{
if
(
filename
)
{
return
'('
+
filename
+
')'
;
return
'('
+
decodeURIComponent
(
filename
)
+
')'
;
}
}
}
}
if
(
domain
&&
domain
!==
title
)
{
if
(
domain
&&
domain
!==
title
)
{
return
'('
+
d
omain
+
')'
;
return
'('
+
d
ecodeURIComponent
(
domain
)
+
')'
;
}
else
{
}
else
{
return
''
;
return
''
;
}
}
...
...
h/static/scripts/filter/test/document-domain-test.js
View file @
9ca30be0
...
@@ -38,6 +38,15 @@ describe('documentDomain', function() {
...
@@ -38,6 +38,15 @@ describe('documentDomain', function() {
assert
(
domain
===
'(MyFile.pdf)'
);
assert
(
domain
===
'(MyFile.pdf)'
);
});
});
it
(
'replaces %20 with " "'
,
function
()
{
var
domain
=
documentDomainFilterProvider
()({
title
:
'example.com'
,
uri
:
'file:///home/seanh/My%20File.pdf'
});
assert
(
domain
===
'(My File.pdf)'
);
});
it
(
'escapes HTML in the document domain'
,
function
()
{
it
(
'escapes HTML in the document domain'
,
function
()
{
var
spamLink
=
'<a href="http://example.com/rubies">Buy rubies!!!</a>'
;
var
spamLink
=
'<a href="http://example.com/rubies">Buy rubies!!!</a>'
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment