Don't copy as GFM when more than GFM is selected

This commit is contained in:
Douwe Maan 2017-01-19 10:02:19 -06:00
parent 9b800bc641
commit b6ac53322e
2 changed files with 6 additions and 0 deletions

View file

@ -260,6 +260,9 @@
const documentFragment = window.gl.utils.getSelectedFragment();
if (!documentFragment) return;
// If the documentFragment contains more than just Markdown, don't copy as GFM.
if (documentFragment.querySelector('.md, .wiki')) return;
e.preventDefault();
clipboardData.setData('text/plain', documentFragment.textContent);

View file

@ -44,6 +44,9 @@
documentFragment = window.gl.utils.getSelectedFragment();
if (!documentFragment) return;
// If the documentFragment contains more than just Markdown, don't copy as GFM.
if (documentFragment.querySelector('.md, .wiki')) return;
selected = window.gl.CopyAsGFM.nodeToGFM(documentFragment);
replyField = $('.js-main-target-form #note_note');