Problem posting C code

  • Author
  • #366815

    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?


    The blog I need help with is


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


    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']
    int main(){
    std::cout << “Hello”;

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


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


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


    You’re welcome.


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


    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.