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
Boxiang Sun
gitlab-ce
Commits
9a0a4f17
Commit
9a0a4f17
authored
Mar 14, 2017
by
Douwe Maan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove selectionToGFM
parent
f9090930
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
9 deletions
+7
-9
app/assets/javascripts/copy_as_gfm.js
app/assets/javascripts/copy_as_gfm.js
+0
-7
spec/features/copy_as_gfm_spec.rb
spec/features/copy_as_gfm_spec.rb
+7
-2
No files found.
app/assets/javascripts/copy_as_gfm.js
View file @
9a0a4f17
...
...
@@ -343,13 +343,6 @@ class CopyAsGFM {
return
codeEl
;
}
static
selectionToGFM
(
documentFragment
,
transformer
)
{
const
el
=
transformer
(
documentFragment
.
cloneNode
(
true
));
if
(
!
el
)
return
null
;
return
CopyAsGFM
.
nodeToGFM
(
el
);
}
static
nodeToGFM
(
node
)
{
if
(
node
.
nodeType
===
Node
.
COMMENT_NODE
)
{
return
''
;
...
...
spec/features/copy_as_gfm_spec.rb
View file @
9a0a4f17
...
...
@@ -579,10 +579,15 @@ describe 'Copy as GFM', feature: true, js: true do
def
html_to_gfm
(
html
,
transformer
=
'transformGFMSelection'
)
js
=
<<-
JS
.
strip_heredoc
(function(html) {
var transformer = window.gl.CopyAsGFM[
#{
transformer
.
inspect
}
];
var node = document.createElement('div');
node.innerHTML = html;
var transformer = window.gl.CopyAsGFM[
#{
transformer
.
inspect
}
];
return window.gl.CopyAsGFM.selectionToGFM(node, transformer);
node = transformer(node);
if (!node) return null;
return window.gl.CopyAsGFM.nodeToGFM(node);
})("
#{
escape_javascript
(
html
)
}
")
JS
page
.
evaluate_script
(
js
)
...
...
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