Problem posting C code

  • Author
    Posts
  • #366815

    Hi
    I’m using this to post C++ code:
    [sourcecode language='cpp'] cout << “Hello”[/sourcecode]

    If i save the post the characters ‘<<‘ are replaced by ‘<<‘

    Why is that?

    Thanks

    The blog I need help with is gracianotorrao.wordpress.com.

    #366924

    Noticed that they show exactly the same in the text above!

    #366926

    Humm … even stranger than i thought.
    I start typing some text and then use the pluging for the code i want to post.
    [sourcecode language='cpp']
    #include<iostream>
    int main(){
    std::cout << “Hello”;
    }
    [/sourcecode]

    Then, when i “save draft” e have to change from visual to HTML and back to visual to make it look ok?!

    #366927

    I would contact staff directly on this. I suspect they need to do some massaging of the code on the backend.

    http://support.wordpress.com/contact/

    #366928

    Thanks for the sugestion.
    I will do some more tests just to make sure.

    #366929

    You’re welcome.

    #367391

    Here is the problem solution:
    Don’t use VISUAL mode for this.
    Use HTML mode :)

    #367392

    In theory you can use the shortcodes in the visual editor and wordpress should take care of it, but using shortcodes in visual mode is not a consistent thing. Thanks for posting that as it had not occurred to me that that could be the issue.

The topic ‘Problem posting C code’ is closed to new replies.