sourcecode output messes up symbols like , & in computer codes

  • Unknown's avatar

    in the [sourcecode language="r"] environment, I need to use the symbols &, < and > . Here is an example: https://xianblog.wordpress.com/2015/04/15/bernouilli-montmort-and-waldegrave/
    Unfortunately, those symbols are not stable and often switch to the HTML ampersand versions, that is, < > into &amp, which means the code is no longer executable. I am certainly not the first user to suffer from this issue, but could not find a proper answer on the forums.

    The blog I need help with is: (visible only to logged in users)

  • Unknown's avatar

    Corrections: I meant the title to be symbols like <, >, &. And the text should read

    Unfortunately, those symbols are not stable and often switch to the HTML ampersand versions, that is, < / > / & into &lt ;/ &gt ;/ &amp ;, which means the code is no longer executable.

  • Unknown's avatar

    I’m afraid that your are in the wrong forum.
    This forum is only for sites/blogs hosted by WordPress.com

    WordPress.COM and WordPress.ORG are completely separate and different http://support.wordpress.com/com-vs-org/

    And you should ask in the WordPress.org forum.
    http://wordpress.org/support/

  • Unknown's avatar

    I do not think you checked my blog page, it is on wordpress.com!

  • Unknown's avatar

    Don’t mind my response above. It’s was for other thread, sorry.

  • Unknown's avatar

    Hi there!

    The issue you described with the sourcecode shortcode is a known bug in our new editor. I’ve added your report to the developer’s report. While we wait on a fix for this, I’d recommend using our classic editor when you need to include the shortcode. The classic editor can be accessed via WP Admin:

    https://xianblog.wordpress.com/wp-admin/

    From the left-hand there, hover over ‘Posts’ or ‘Pages’ to either ‘Add New’ or manage your existing content.

    Hope this helps! Please don’t let me know if you have extra questions around that.

  • Unknown's avatar

    Thanks for the reply, siobhyb. However it does not fit my problem: I only use the classic editor and have had this problem for ages, way before the new (and btw terrible) editor was introduced…

  • Unknown's avatar

    Hi there.

    Thanks for clarifying that you only use the classic editor!

    Could you let me know if the symbols are being switched to HTML upon first publishing a post? We usually only see this happening after a post has been edited, usually in the new editor, or, if you’re in the classic editor, after old revisions have been restored.

    If you could let me know some extra details behind the steps that come before you usually see this issue, it’ll really help us out in pinpointing the problem.

  • Unknown's avatar

    Hi! Thanks for pursuing this thread. Indeed, I believe the change of < in my code into `<‘ only occurs when I later re-edit my entry (always under the classic editor), rather than at the first time I post it. Even without changing anything within the code part, i.e., within the part between [sourcecode] and [/sourcecode]. But since I very rarely restore old versions of the entry, this does not seem related. Another feature of my writing post is that I often leave a page open under the classical editor for quite a while, which may impact the number of revisions.

  • Unknown's avatar

    Hi there.

    I’ve done a bit more testing on this but haven’t yet been able to replicate. I wanted to let you know that I’ll keep testing out a few things earlier next week and will get this reported back once I’m able to pinpoint exactly how/when this issue comes up.

  • Unknown's avatar

    Hi there!

    Sorry for the delay in following up on this. After some more testing and given your last comments, I’m fairly positive that this is related to a previously reported issue that our developers are aware of. As it’s a fairly inconsistent and the number of people affected isn’t too high, I’m unable to make any promises about a deadline for a fix. However, I can promise that our developers have been made aware of the error.

  • Unknown's avatar

    Thanks! I figure I am not the only one using the sourcecode environment with languages involving < >or &

  • The topic ‘sourcecode output messes up symbols like , & in computer codes’ is closed to new replies.