18

I noticed that when I post source code in a Blogger post, the code wraps to the next line if it's too long. I use the pre tag to post the code and I used different styles (overflow: auto; white-space: pre), still the code wraps in all browsers except in FireFox.

Is there a way to post source code without having the code wraps?

6 Answers 6

7

Set the word-wrap property to normal.

0
9

Checkout Syntax Highlighter if you already haven't. You can easily integrate it with blogger.

1
  • +1: Finally, a syntax highlighter that doesn't copy over the line numbers! Many thanks, sir!
    – Jay Wick
    Sep 13, 2010 at 3:00
1

Use Code Prettify.

I' have written some notes on how to.

0

I've been using PreCode and SyntaxHighlighter for a while and it seems to work best for me. My blog readers also enjoy copy/pasting functionality built-in.

0

Using Github Gist, you can create "pretty" code which you can embed within a Blogger post. If you modify this code anytime, it will automatically show up in the blog post as well.

-1

Click on New Post Then Compose Mode write your code there. enter image description here

just write/paste code there.

1
  • How does it answer the question? Sep 8, 2016 at 19:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.