Search This Site

Custom Search

Sunday, July 4, 2010

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

I believe just as in the "code" editor for blogger \n characters are
translated to break tags. You can avoid it by avoiding white space
line breaks. In your code example:

content = "<p>hello</p><p>bye</p>"

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