Problems, need help? Have a tip or advice? Post it here.
3 posts Page 1 of 1
Hi,

Here's my problem: Couch is adding paragraph tags after each first word of a new paragraph.

I have a richtext field
Code: Select all
<cms:editable name='box3_text2' label='Text' group='box3_group' type='richtext' toolbar='basic' />
and some jquery code to put overfloed text into another div:

Code: Select all
   $(document).ready(function(){

      var currentCol = $('.col:first');
      var text = currentCol.html();
      currentCol.text('');
      text = text.replace(/ (?![^<>]*>)/gi, '%^%');
      var wordArray = text.split('%^%');
      
      $.fn.hasOverflow = function() {
         if($(this).attr('id')){
            var div= document.getElementById($(this).attr('id'));
            return div.scrollHeight>div.clientHeight;
         }
      };
      
      for(var x=0; x<wordArray.length; x++){
         var word= wordArray[x];
          currentCol.append(word+' ');
          if (currentCol.hasOverflow()){
             if(!currentCol.hasClass('col2')){
                 currentCol = currentCol.parent().parent().find(('.col2'));
              }
          }
      }


I've asked something about the jquery on stack exchange (over here), maybe the codes don't work well together, but i can't find what is causing the error.

The website is http://ruudvoesten.nl/index6.php and the problem I'm talking about is in the Biografie section.
Hi,
Couch is adding paragraph tags after each first word of a new paragraph.
I had a look at the webpage you mentioned and, actually, it is not Couch that is adding the paragraphs after each first word.

If you turn off JavaScript or simply do a view-source, you'll see that the <p> tags are around each full paragraph as they should be.

I think the JS code you are using has something to with the phenomenon you noticed.
Thank you for taking a look. The <p> problem is gone when I disable the whole currentCol section, so I think it's not Couch related indeed. :)
3 posts Page 1 of 1
cron