adamwulf / Columnizer-jQuery-Plugin

The Columnizer jQuery Plugin will automatically layout your content in newspaper column format. You can specify either column width or a static number of columns. And, of course, it’s easy to use!
http://welcome.totheinter.net/columnizer-jquery-plugin/
Other
758 stars 147 forks source link

Piece of text is lost if split a link #190

Open schi opened 9 years ago

schi commented 9 years ago

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.

adamwulf commented 9 years ago

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

schi commented 9 years ago

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 commented 9 years ago

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