Columnizer-jQuery-Plugin icon indicating copy to clipboard operation
Columnizer-jQuery-Plugin copied to clipboard

Piece of text is lost if split a link

Open schi opened this issue 10 years ago • 3 comments

Latest from master cut off some text and destroy. In a two column layout you have a content like

<p>Lorem ipsum dolor sit amet, consetetur  <a href="https://www.domain.com/?id=293" data-htmlarea-external="1">sadipscing elitr, sed diam nonumy</a> eirmod tempor invidunt ut labore et dolore magna aliquyam erat, sed diam voluptua.</p>

and second column start with link <a href="... the left column content get lost. Right column content is moved to left column.

schi avatar Jun 08 '15 14:06 schi

hrm that's no good. can you post a jsfiddle with an example showing the bug?

adamwulf avatar Jun 08 '15 17:06 adamwulf

Hi Adam Thank you for your quick response. I build a jsfiddle to show the bug: https://jsfiddle.net/WebTekk/yh7xq5rf/10/

Hope you can fix them. Greetings, Heinz

schi avatar Jun 09 '15 06:06 schi

Hi Adam The bug is in block at line 349ff

                            if(onlyNode.nodeType == 3){
                                // text node
                                var whitespace = /\s/;
                                var str = onlyNode.nodeValue;
                                if(whitespace.test(str)){
                                    // yep, only a whitespace textnode
                                    $clone.remove();
                                    $cloneMe.removeClass(prefixTheClassName("split"));
                                }
                            }
 if(whitespace.test(str)){

This condition find ALL whitespaces in a text and remove the whole text.

I change this to

                                if(whitespace.test(str) && str.length == 1){

Can you please check if this make sense? Greetings, Heinz

schi avatar Jul 08 '15 08:07 schi