Need help? Check out our Support site, then


sourcecode is not running!

  1. Hi everyone!,

    i have a blog and address is ; http://gelistiriyorum.wordpress.com/
    i include some c# programming code in my posts. About 3-4 days ago codes was display like an editor for example; line numbers, colors etc.

    But now code lines display with a big quote i used coding lines like this;

    [sourcecode language="csharp"]
    bla bla...
    [/sourcecode]

    what is problem? have any suggestion?

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

  2. This is the only support documentation for posting source code:
    http://en.support.wordpress.com/code/posting-source-code/
    http://en.support.wordpress.com/code/

    I've also flagged this thread for a Staff response.

  3. Hi,

    I viewed the three C# posts on your blog and the source code displays properly for me in Google Chrome 21.0.1180.89.

    Can you try clearing your browser cache?

  4. I'm having same issue, not with XML but with posting HTML in sourcecode shortcode. It is extremely annoying.

    cvanhasselt.wordpress.com

    I haven't published the post yet, just trying to slog through which is painful. It seems like after you save a couple of times, it ignores that it is source and html escapes the entire line, throwing in " and other noise that shouldn't be displayed.

  5. Hi cvanhasselt,

    I'm sorry for the inconvenience, and I'll be more than happy to take a look.

    What's the title of the draft post in question?

  6. I finally got around to publishing this after much trial and error.
    The published post is http://cvanhasselt.wordpress.com/2012/10/14/revamping-the-list-o-books-part-2/

    You'll notice that there is no image associated with this post. The upshot of what I discovered after a lot of twiddling, which may help you, is that the sourcecode shortcode seems to rewrite when you use the "Media Gallery" to insert a suggested image into the post, it rewrites the whole post, HTML-encoding the stuff enclosed in the [sourcecode] shortcode section. This messes up the code text.

    I've also added a dumb draft post called "test" on my site (if you can get to that) where I've tried this out. You can see in the Visual Editor how the sourcecode has been junkified. If you try successive pictures from the recommended ones, it keeps trying to re-encode the section, so it starts adding stuff to the section that you don't want.

  7. Please let me know what you find out, or if you have other questions.

  8. Hi cvanhasselt,

    Thanks for your reply, and I'm sorry for the delay. I noted that on your test (draft) post that you used:

    [sourcecode type="text"][/sourcecode]

    Does changing that to language="text" help with that?

    I also tried copying a sourcecode example on your published post, then inserting an image from both a URL and Media Library (in Visual Editor), but wasn't able to reproduce the sourcecode HTML-encoding issue you described.

    Are you still able to reproduce this?

  9. I haven't tried, but will give it a go. If so, is there are location where I can send screenshots, or is that helpful?

  10. Screenshots are totally helpful. You can upload those images to your Media Library, then paste the file URL to it in this forum thread.

  11. Ok, I just updated the "test" post using your suggestion, language = "text" Then, I deleted the photo I had in there. I inserted a photo from the media gallery - the recommended photos. After the first photo, there was no change in the source code section - the regular expression looked correct. Then, I inserted a second photo, and that is when the bad replacements started happening. When I inserted a third photo, every ampersand was replaced by &, so it just sort of devolved from there.

    I'm not sure what would happen if I just inserted a photo from the media library, rather than the media gallery. I have a hunch I could get around this by inserting the image, copying to my desktop, saving to my media library and inserting from there, but that is really a convoluted workaround. I haven't tried that, but my hunch is that because the recommendation engine must be parsing my text, there is a lot of interaction with the text and code that wouldn't happen if I just inserted from media gallery, but you'll know better than I will.

    Thanks!

  12. I tried inserting a photo from media library, on another post (the dijonnaise one). That post doesn't have a sourcecode section now, but while it was in draft mode I put one in and tried it out and could not reproduce the errors while inserting from the the media library. So, the problem does seem to be associated with the media gallery insert.

Topic Closed

This topic has been closed to new replies.

About this Topic