BigW Consortium Gitlab
Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gitlab-ce
Project
Overview
Details
Activity
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
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
Forest Godfrey
gitlab-ce
Commits
9f322f2b
Unverified
Commit
9f322f2b
authored
Feb 21, 2017
by
Luke "Jared" Bennett
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added double newline after file upload markdown insert
parent
459a97d4
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
dropzone_input.js
app/assets/javascripts/dropzone_input.js
+3
-2
issues_spec.rb
spec/features/issues_spec.rb
+9
-0
No files found.
app/assets/javascripts/dropzone_input.js
View file @
9f322f2b
...
...
@@ -126,13 +126,14 @@ require('./preview_markdown');
};
pasteText
=
function
(
text
)
{
var
afterSelection
,
beforeSelection
,
caretEnd
,
caretStart
,
textEnd
;
var
formattedText
=
text
+
"
\
n
\
n"
;
caretStart
=
$
(
child
)[
0
].
selectionStart
;
caretEnd
=
$
(
child
)[
0
].
selectionEnd
;
textEnd
=
$
(
child
).
val
().
length
;
beforeSelection
=
$
(
child
).
val
().
substring
(
0
,
caretStart
);
afterSelection
=
$
(
child
).
val
().
substring
(
caretEnd
,
textEnd
);
$
(
child
).
val
(
beforeSelection
+
t
ext
+
afterSelection
);
child
.
get
(
0
).
setSelectionRange
(
caretStart
+
text
.
length
,
caretEnd
+
t
ext
.
length
);
$
(
child
).
val
(
beforeSelection
+
formattedT
ext
+
afterSelection
);
child
.
get
(
0
).
setSelectionRange
(
caretStart
+
formattedText
.
length
,
caretEnd
+
formattedT
ext
.
length
);
return
form_textarea
.
trigger
(
"input"
);
};
getFilename
=
function
(
e
)
{
...
...
spec/features/issues_spec.rb
View file @
9f322f2b
...
...
@@ -577,6 +577,15 @@ describe 'Issues', feature: true do
expect
(
page
.
find_field
(
"issue_description"
).
value
).
to
have_content
'banana_sample'
end
it
'adds double newline to end of attachment markdown'
do
drop_in_dropzone
test_image_file
# Wait for the file to upload
sleep
1
expect
(
page
.
find_field
(
"issue_description"
).
value
).
to
match
/\n\n$/
end
end
end
...
...
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