WordPress.com Source Code Still Being Altered

  • Unknown's avatar

    I have been using the [code] tags to post source code on my blog. Sometimes I have to remove the language='r' parameter because it causes the code to show up as plaintext, removing all my formatting. That's very disappointing. But what really infuriated me today is that whatever voodoo WordPress.com does to 'clean up' my page (detecting and removing HTML) was still working on that source code, causing it to garble my code. It took maybe 20 minutes for me to figure out how to trick the site into displaying my code correctly.

    Here is the blog post in question: https://ntguardian.wordpress.com/2018/08/13/evaluating-olive-mcbride-arkham-horror-lcg-chaos-bag-simulator-r/ Go to the long code segment that is labeled AHOliveDistributionEstimator.R, near the bottom. Line 54 required a lot of tricks to get to work correctly. If you were to remove the extra space in mean(res >= v) and post that code block verbatim (after that change) wrapped in [code][/code], line 54 would become r = v)}) which is pure nonsense.

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

  • Unknown's avatar

    Hi there,

    Can you try it from the WP Admin page/post editor and see if that works.
    I tried your code and it was not working properly in Calypso as you mentioned.
    But when I switched to wp-admin, it is working perfectly. Also, use the Text view to paste your code. HTML view is garbling the code.

    Here’s another thread that discusses the issue with Calypso in displaying the code.
    https://en.forums.wordpress.com/topic/posting-source-code-bugs/

    Hope that helps :)

  • Unknown's avatar

    Hi ntguardian,

    Sometimes I have to remove the language=’r’ parameter because it causes the code to show up as plaintext, removing all my formatting.

    Does the formatting issue occur when switching between HTML and Visual editor tabs?

    Could you also paste the original code you entered here (using the code button) so I can take a closer look?

    Thanks!

  • The topic ‘WordPress.com Source Code Still Being Altered’ is closed to new replies.