salimoha / googlecl

Automatically exported from code.google.com/p/googlecl
0 stars 0 forks source link

Not good formatting #407

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

1. google blogger post "my new python program" .../spam.py
2. review in blogger 
3. Oops.. All indentations is lost.

What is the expected output?
a: indentation in code
What do you see instead?
a: indentation is lost

What version of the product are you using?
a: 0.9.9
On what operating system?
a: Debian 6.0.2
What version of gdata-python-client (aka python-gdata)?
a: 2.0.8.-1.1

Please provide any additional information below.
a: no additional information

Original issue reported on code.google.com by osmpa...@gmail.com on 18 Jul 2011 at 10:51

GoogleCodeExporter commented 9 years ago
In first step I mean 
google blogger post --title "my new python program" .../spam.py

Original comment by osmpa...@gmail.com on 18 Jul 2011 at 10:53

GoogleCodeExporter commented 9 years ago
googlecl has nothing to do with this issue because it sends the file to Blogger 
without any modifications.

I believe Blogger cleans up the additional space/tab chars. The data/file sent 
to Blogger is expected to be HTML code.

In order to keep your indentation, you need to

  1. Escape your source code for HTML.
  2. Wrap the escaped code with `<pre>`. (optional, or you will also need to escape consecutive spaces)

It can be done with additional script and pipe into googlecl (Issue 104), 
`<command to escape> file | google.py blogger post __`

Or maybe a new option for escaping?

Original comment by livibet...@gmail.com on 7 Aug 2011 at 3:03

GoogleCodeExporter commented 9 years ago
> I believe Blogger cleans up the additional space/tab chars.
Blogger doesn't modify your post content.  GoogleCL sets the content type to 
HTML, and Blogger publishes the content as such.  Like you're saying you should 
use ' 's or <pre> for preserving indentation.

Original comment by t.ma...@gmail.com on 3 Oct 2011 at 10:49

GoogleCodeExporter commented 9 years ago
This occurs even if you use <pre> elements. I created a new blog with some 
source code in it and I used <pre> elements to surround the code and Google ate 
all my whitespace. Stupid Google corrupts my data!

Original comment by buck.rob...@gmail.com on 23 Nov 2011 at 2:16

GoogleCodeExporter commented 9 years ago
Works correctly with <pre> elements. Tested on code from trunk.

Original comment by szy...@endpoint.com on 29 Dec 2012 at 8:13