Search This Site

Custom Search

Sunday, July 18, 2010

[bloggerDev] Re: Uploading posts through api add a lot of
tags, how to avoid that?

Hi Gabriele,

Try changing at YourBlog.settings.formatting."Convert line breaks"
from YES to NO. This setting says "If Yes is selected, single hard-
returns entered in the Post Editor will be replaced with single <br />
tags in your blog, and two hard-returns will be replaced with two tags
(<br /><br />)." Let me know if that helps.

All the best,

Joe

On Jun 22, 7:07 am, "gabriele.lanaro" <gabriele.lan...@gmail.com>
wrote:
> Hi! I'm using the python APIhttp://code.google.com/apis/blogger/docs/1.0/developers_guide_python....
> to upload posts to blogger and it works very well.
>
> The problem is that if in the content filed I put my html (formatted)
> it inserts a lot of <br/>, for example:
>
> def CreatePublicPost(blogger_service, blog_id, title, content):
>   entry = gdata.GDataEntry()
>   entry.title = atom.Title('xhtml', title)
>   entry.content = atom.Content(content_type='html', text=content)
>   return blogger_service.Post(entry, '/feeds/%s/posts/default' %
> blog_id)
>
> content = """<p>hello</p>
> <p>bye</p>"""
>
>  CreatePublicPost(...,content)
>
> would publish an entry with something like that:
>
> <p>hello</p><br/>
> <p>bye</p>
>
> There's a way to avoid that? Why this behaviour?

--
You received this message because you are subscribed to the Google Groups "Blogger Developer Group" group.
To post to this group, send email to bloggerdev@googlegroups.com.
To unsubscribe from this group, send email to bloggerdev+unsubscribe@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/bloggerdev?hl=en.

No comments:

Post a Comment