Medium.js icon indicating copy to clipboard operation
Medium.js copied to clipboard

order of lines inversed on paste

Open pat123456 opened this issue 9 years ago • 5 comments

Hello,

when copy a text, for example this one : a b c

and paste it, it became : c b a

pat123456 avatar Aug 05 '15 09:08 pat123456

this seem to resolve the problem ?, but don't know if it will have some bad repercussions in the rest of the code : (in Medium.Injector.prototype line 1732 )

    if (isConverted) {
        //make an array of elements that are about to be inserted, can't use html because they will
        while (i < html.length) {
            nodes.push(html[i]);
            i++;
        }
        /*while (html.length > 0) {
            console.log(html[html.length - 1])
            parent.insertBefore(html[html.length - 1], wedge);
        }*/
        for (var j=0; j<nodes.length ;j++) {
            parent.insertBefore(nodes[j], wedge);
        }
    }

pat123456 avatar Aug 05 '15 12:08 pat123456

sorry, didn't saw that the bug was already reported in the "closed issues" https://github.com/jakiestfu/Medium.js/issues/133 but the code doesn't seem to have been changed in the official medium.js file and in the doc page ? http://jakiestfu.github.io/Medium.js/docs/

pat123456 avatar Aug 05 '15 13:08 pat123456

@pat123456 I believe this specific bug is still open. Bug #133 (which I just ran into) was causing the ability to paste to not work at all. (I saw this in release 1.0.1.)

I am still seeing this specific issue with copy and paste reversing the order.

Edit: Nevermind. I see you are referencing f8abd157565d within that chain. My mistake. I'm going to take a look at that now.

jasoncavett avatar Jun 08 '16 19:06 jasoncavett

I am seeing this issue when inserting HTML as well via insertHTML('<ul><li></li></ul>');.

vhmth avatar Nov 14 '16 22:11 vhmth

https://github.com/jakiestfu/Medium.js/issues/203

vhmth avatar Nov 14 '16 23:11 vhmth