extra line breaks in the main page but not in the message.

Random stuff about serendipity. Discussion, Questions, Paraphernalia.
Post Reply
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

extra line breaks in the main page but not in the message.

Post by periferral »

I'm trying fix some kinks on my site. I was running 0.9 and I didnt see a problem but I just changed servers and now I seeing some issues. I still have both servers up and running.

So here is the first issue. The new blog sire is here
http://www2.periferral.com/serendipity/

You can see the line breaks between the text and the pictures.

Now if you click on that exact blog itself
http://www2.periferral.com/serendipity/ ... tache.html

It is fine. Well actually it has no line breaks at all.

Code: Select all

Anyway, my dear friend VinVin is all psyched out about one since he saw Matador. Pierce Brosnan is no Selleck but still VinVin seems to be all taken in. Sooooooo, to prove to him how ridiculous he would look, I took on my own little photoshop project.
<table width="100%">
  <tr>
    <td> <img src="http://www.periferral.com/webimg/selleck.jpg"> </td>
    <td> <img src="http://www.periferral.com/webimg/vinbefore.jpg"> </td>
    <td> <img src="http://www.periferral.com/webimg/vinafter.jpg"> </td>
  </tr>
  <tr>
    <td align="center"> <B> Oooh! </B> </td>
    <td align="center"> <B> VinVin Before </B> </td>
    <td align="center"> <B> VinVin After </B> </td>
  </tr>
</table>
<BR>
Hmmm.. very interesting. 


The same thing on my old site looks fine both ways
http://www.periferral.com/blogThis/

http://www.periferral.com/blogThis/inde ... tache.html
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: extra line breaks in the main page but not in the messag

Post by garvinhicking »

Hi!

Wow, that's weird. Never saw that happen. Actually the functions should be the same for displaying an entry on the overview and the detail pane.

Which event plugins do you have installed? Maybe the simplecache plugin?

Regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

garvin, here is a list of plugins I am using.

Sidebar:

Calendar
Recent Entries
Categories
Syndicate
Quicksearch
Blog Admin

Event:

Markup: Serendipity
Markup: Emoticate
Nl2br
browser compatibility
spam protector
spartacus
split long entries

thats it.
vancouver_guy
Posts: 3
Joined: Fri Nov 24, 2006 3:18 am

re: extra line breaks

Post by vancouver_guy »

Greetings:
I've encounter the same issue. I removed the Nl2br plugin and everything worked fine again. You can remove the plugin and then re-publish that particular entry. I went in to my database and edited the entry from there; also, if editing from the database, where you would expect to see a "<br />"
you'll just see an empty space - make sure there is no empty space at the top of your entry.
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

hey vancouver_guys. thanks for your post. I tried what you suggested. Here is what I did.
I disabled nl2br. then when to the the admin page and edited the post and removed all the <br> tags and replaced them with line breaks. Then I went back and enabled the nl2br plugin

now i have the reverse problem. Now I cant get the new lines to be converted to line breaks. The problem seems to be with only this post.

when i disabled the plugin .. all posts lost their line breaks. when i re-enabled the plugin all the other posts went back to the usual.
vancouver_guy
Posts: 3
Joined: Fri Nov 24, 2006 3:18 am

re: breaks

Post by vancouver_guy »

I looked at your source code - very interesting, I've never seen it do this before; it's inserting breaks at the end of every line, even in the table structure. For me, it inserted a "mysterious" break at the end of my text, and like you, it only happened for the first post - and it didn't effect the other posts. As I mentioned in my previous post, I edited my entry from my database and then it was OK. If you want to try it find "serendipity_entries" in your database, then find the entry and in the text body enter your source code and save it. If you do edit the database, before doing anything, make sure you make a copy of the post - just in case. Of course, this doesn't solve the real issue as to why this occurs, and if you do a search of this forum for "nl2br" you will find a number of possible causes. Fortunately - I'm sure Garvin will find the answer for you. :)
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: re: breaks

Post by garvinhicking »

Hi!

The nl2br plugin is there to transform newlines/linebreaks to <br /> Tags. It does this always when displaying an entry. The entry is NOT saved with '<br>' tags in the database.

However, the logic of that plugin is the same for displaying on the frontpage and displaying on the detail page, so I can'T explain why this is happening on periferals blog.

Periferal, are you by any chance using the WYSIWYG-Editor? Maybe this one is acting weird.

Also, could you try to temporarily remove the "split long entries" plugin and see if that changes things?

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

garvin
under personal settings - Use WYSIWYG editor
i have said no.

I removed recent entries plugin. No difference. Currently it is still disabled.


As vancouver guy suggested, it happens only to the first post. I could create a new dummy post to see if it changes this one to its "normal state".

it is possible that the code is the same but since the main page shows all posts and the specific blog page only shows 1 post along with the comments for that blog, the code is possibly going slightly different routes and causing the first post to cause this problem.

vancouver guy, i dont use phymyadmin or something like this so i havent changed anything in my db directly. are you suggesting I change this and then do nl2br again? I want nl2br because Id rather not go into each post and add <br> tags.

finally, i saw a post about an improved nl2br plugin. i don't suppose that fix addressed this issue. Looking at the code in firefox, i see <br /> tags. when i ran this webpage through an html validation, each line with this tag gave me errors.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!
I removed recent entries plugin. No difference. Currently it is still disabled.
No, I wrote remove the "split long entries" plugin, did you try that? :)

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
vancouver_guy
Posts: 3
Joined: Fri Nov 24, 2006 3:18 am

NL2BR

Post by vancouver_guy »

Greetings:
I re-installed the nl2br plugin - just to do some testing ( I have my site working fine with out it). I removed most of the plugins and it had no effect; I also played with the configuration of nl2br and the Markup plugins - again no effect. I do most of my work in FireFox 1.0.7 so I opened Serendipty in IE 6. I had no problem when using IE; there were no "extra" breaks showing up and everything was working fine. Try adding or editing a post using IE as your browser. I don't know why this would make any difference but it did for me.
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

garvin. my bad. I meant to say i removed split long entries but I said I removed recent entries instead. If you look at the blog page, recent entries is still enabled but split long entries is disabled.

vanc guy, ill give editing the post in IE and saving it to see if that makes any diff.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post by garvinhicking »

Hi!

Hm, okay. This is getting absolutely weird. Does changing the template to the default template maybe work?

Another idea: Did you modify ANY PHP files on your installation manually?

Currently I'm a bit out of options, I believe the only thing left to do for me would be to have FTP access to your site to check some things - because I sadly can'T reproduce it here on my test installations! :(

Best regards,
Garvin
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

garvin, i'm not sure which the default theme is. I tried serendipity 2.3 and 3 and both seem to have the same problem.

i'm pretty sure I havent changed any code on the plugins. Ive only messed with the templates this far. I plan to work on the plugins after i got the look and feel correct.
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

garvin once youve looked into the files on my server, I will try vancouver guys suggestion of editing the post in IE and see if that works.

Ideally though it would be good to fix the root cause of the problem rather than a workaround.
periferral
Regular
Posts: 14
Joined: Tue Jan 17, 2006 7:30 pm

Post by periferral »

as usual, garvin to the rescue. He figured out the issue. For some reason I had serendipity_entryproperties plugin installed on my old blog. When i switched over to the new site, I didnt have that plugin. Also for some strange reason, that plugin had set the nl2br plugin to off for the last post.

everything is resolved now. I dont plan to use the serendipity_entryproperties plugin so i just deleted that from the DB.

Thanks guys for all the input and a special thanks for garvin for debugging this.
Post Reply