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
1
Merge Requests
1
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
nexedi
gitlab-ce
Commits
386754a9
Commit
386754a9
authored
Jan 31, 2020
by
Jesse Hall
Committed by
Peter Leitzen
Jan 31, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix for #198353, copied and pasted markdown video/audio snippets not playable
parent
d8149c08
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
1 deletion
+29
-1
app/assets/javascripts/behaviors/markdown/nodes/playable.js
app/assets/javascripts/behaviors/markdown/nodes/playable.js
+1
-1
spec/features/markdown/copy_as_gfm_spec.rb
spec/features/markdown/copy_as_gfm_spec.rb
+28
-0
No files found.
app/assets/javascripts/behaviors/markdown/nodes/playable.js
View file @
386754a9
...
...
@@ -42,7 +42,7 @@ export default class Playable extends Node {
},
{
tag
:
`
${
this
.
mediaType
}
[src]`
,
getAttrs
:
el
=>
({
src
:
el
.
getAttribute
(
'
src
'
)
,
alt
:
el
.
dataset
.
title
}),
getAttrs
:
el
=>
({
src
:
el
.
src
,
alt
:
el
.
dataset
.
title
}),
},
];
...
...
spec/features/markdown/copy_as_gfm_spec.rb
View file @
386754a9
...
...
@@ -172,18 +172,36 @@ describe 'Copy as GFM', :js do
'![Image](https://example.com/image.png)'
)
verify_media_with_partial_path
(
'![Image](/uploads/a123/image.png)'
,
project_media_uri
(
@project
,
'/uploads/a123/image.png'
)
)
verify
(
'VideoLinkFilter'
,
'![Video](https://example.com/video.mp4)'
)
verify_media_with_partial_path
(
'![Video](/uploads/a123/video.mp4)'
,
project_media_uri
(
@project
,
'/uploads/a123/video.mp4'
)
)
verify
(
'AudioLinkFilter'
,
'![Audio](https://example.com/audio.wav)'
)
verify_media_with_partial_path
(
'![Audio](/uploads/a123/audio.wav)'
,
project_media_uri
(
@project
,
'/uploads/a123/audio.wav'
)
)
verify
(
'MathFilter: math as converted from GFM to HTML'
,
...
...
@@ -647,6 +665,16 @@ describe 'Copy as GFM', :js do
end
end
def
project_media_uri
(
project
,
media_path
)
"
#{
project_path
(
project
)
}#{
media_path
}
"
end
def
verify_media_with_partial_path
(
gfm
,
media_uri
)
html
=
gfm_to_html
(
gfm
)
output_gfm
=
html_to_gfm
(
html
)
expect
(
output_gfm
).
to
include
(
media_uri
)
end
# Fake a `current_user` helper
def
current_user
@feat
.
user
...
...
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