I am trying to paste a piece of code in my Google+ stream but it removes the whitespace from the start of the lines making the code less appealing, aesthetically speaking. Basically, the functionality that I'm after is the "Code Sample" button of the WYSIWYG editor that I'm writing on right now.
|
You could add the code to something like Pastebin; and then share it as a link. Hope this helps. |
|||
|
|
Em space works!I've finally cracked this indentation issue in Google+. I use em space and Google+ doesn't simply remove/replace it. It stays there. The only problem is how do you type it out? Its Unicode code is U+2003 but there's not keyboard shortcut... How I used it is:
Then you can simply go and edit your Google+ post and paste it as many times as you need to indent your code. This procedure seems complicated, but it's not really. These are few fast and easy steps. It's also true that you most likely don't put code in all of your posts anyway. Here's a link to Google+ post that also includes some indented code. |
||||
|
|
|
Google+ doesn't offer many formatting options. At best it offers a very watered down version of Markdown, with only bold, italic, and strikethrough. So unless and until Google adds more options you're out of luck. The only other possible option would be to create a GIF with the text of your code and include that in your post. |
|||
|
|
|
I made a tool for converting code to Google+ compatible code. You find it at http://www.claudiodangelis.it/projects/googlepluscodeindenter Here an example post: https://plus.google.com/u/0/115859961800127275872/posts/Sg9aSkCwTft Hope this helps. |
||||
|
|
|
Google have apparently recently made a change to Google+ whereby the spaces at the beginning and/or end of a line for both posts and comments is retained rather than discarded, which was the previous behavior. I just tested it and it works. |
|||
|
|
|
I use
|
|||
|
|