Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Tatuya Kamada
gitlab-ce
Commits
9f322f2b
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
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
2 deletions
+12
-2
app/assets/javascripts/dropzone_input.js
app/assets/javascripts/dropzone_input.js
+3
-2
spec/features/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');
...
@@ -126,13 +126,14 @@ require('./preview_markdown');
};
};
pasteText
=
function
(
text
)
{
pasteText
=
function
(
text
)
{
var
afterSelection
,
beforeSelection
,
caretEnd
,
caretStart
,
textEnd
;
var
afterSelection
,
beforeSelection
,
caretEnd
,
caretStart
,
textEnd
;
var
formattedText
=
text
+
"
\n\n
"
;
caretStart
=
$
(
child
)[
0
].
selectionStart
;
caretStart
=
$
(
child
)[
0
].
selectionStart
;
caretEnd
=
$
(
child
)[
0
].
selectionEnd
;
caretEnd
=
$
(
child
)[
0
].
selectionEnd
;
textEnd
=
$
(
child
).
val
().
length
;
textEnd
=
$
(
child
).
val
().
length
;
beforeSelection
=
$
(
child
).
val
().
substring
(
0
,
caretStart
);
beforeSelection
=
$
(
child
).
val
().
substring
(
0
,
caretStart
);
afterSelection
=
$
(
child
).
val
().
substring
(
caretEnd
,
textEnd
);
afterSelection
=
$
(
child
).
val
().
substring
(
caretEnd
,
textEnd
);
$
(
child
).
val
(
beforeSelection
+
t
ext
+
afterSelection
);
$
(
child
).
val
(
beforeSelection
+
formattedT
ext
+
afterSelection
);
child
.
get
(
0
).
setSelectionRange
(
caretStart
+
text
.
length
,
caretEnd
+
t
ext
.
length
);
child
.
get
(
0
).
setSelectionRange
(
caretStart
+
formattedText
.
length
,
caretEnd
+
formattedT
ext
.
length
);
return
form_textarea
.
trigger
(
"
input
"
);
return
form_textarea
.
trigger
(
"
input
"
);
};
};
getFilename
=
function
(
e
)
{
getFilename
=
function
(
e
)
{
...
...
spec/features/issues_spec.rb
View file @
9f322f2b
...
@@ -577,6 +577,15 @@ describe 'Issues', feature: true do
...
@@ -577,6 +577,15 @@ describe 'Issues', feature: true do
expect
(
page
.
find_field
(
"issue_description"
).
value
).
to
have_content
'banana_sample'
expect
(
page
.
find_field
(
"issue_description"
).
value
).
to
have_content
'banana_sample'
end
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
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