6 messages in com.googlegroups.bloggerdevRe: [bloggerDev] Re: POLL: Do you rel...
FromSent OnAttachments
Pete Hopkins ☠28 Mar 2007 12:23 
Erwan28 Mar 2007 14:49 
Pete Hopkins ☠28 Mar 2007 16:42 
Joe Cheng [MSFT]29 Mar 2007 16:10 
Tom30 Mar 2007 08:40 
logh...@gmail.com01 Apr 2007 14:12 
Subject:Re: [bloggerDev] Re: POLL: Do you rely on Blogger to convert linebreaks into <br>s?
From:Pete Hopkins ☠ (phop@google.com)
Date:03/28/2007 04:42:30 PM
List:com.googlegroups.bloggerdev

On 3/28/07, Erwan <eloi@gmail.com> wrote:

In Flock, when possible I'm sending line breaks rather than <br> or <p> tags and relying on the server to convert them to HTML. When the server requires <br> tags, the user works with line breaks in the editor and I convert to <br> tags only at publication time.

The reason is that some platforms (such as Wordpress) store line breaks in their database and convert them to HTML as late as possible, when displaying. That makes it easier for people who like to edit HTML by themselves. A lot of people will use the source pane for bold, italic, links and so on, but not for line breaks because it's a bit heavy to edit with <br> and <p>.

Blogger actually proposes that kind of editing by default; in the source pane line breaks get converted to <br>, right? So, if you choose 2., what would happen in the following scenario? * The user has the default "convert line breaks to <br>" * He publishes from a desktop application that is sending everything in HTML, with <br> tags * He edits the post and go to the "source" pane. => Does he sees the post with <br> tags and no line breaks? That would be an issue, and that's why I'm now sending line breaks to servers like Wordpress.

In the scenario you describe, the user would right now see <br> tags.

If I implemented my proposed change (option 2), Blogger would convert those <br> tags on API input into linebreaks when it saves the post body.

You suggest that this problem is more likely to appear with 1 but it seems to me that this would happen with 2.

What I would really want is a pref at publication time to set new line conversion on/off (like most XMLRPC APIs), but if I have to choose between 1 and 2, 2 is probably better. With 1 clients relying on line break conversion will break for some users anyway, they will need to be fixed, so it's better to make the breakage obvious so they can get fixed earlier.

I agree that linebreak conversion should more often than not be a by-post setting (rather than by-blog), but at the same time it is always within the API client's power to offer that choice to the user. If you know that Blogger will handle linebreaks consistently regardless of user settings (e.g., Blogger always expects <br> tags) then you can convert linebreaks to <br> or not in your own app, depending on the user's choice.

Thx for your response!

-- Pete