• I began using MoSI in my blog but began seeing some strange behavior.

    I occasionally include Unity3D C# example code, which is a language that uses angled brackets for referring to classes when using generics, eg:


    TestClass tc = GetComponent<TestClass>();

    Just in case the line above doesn’t show up properly in this comments section, it’s
    TestClass tc = GetComponent LESS_THAN TestClass GREATER_THAN ();
    please do the character replacement in your head 😐

    MoSI does retain the angled brackets when saving, but turns everything contained within the brackets into lowercase. In the example it would make TestClass into testclass.

    As C# class names are case-sensitive, this breaks the functionality of the code blocks. Have I stumbled onto a previously unknown bug or is it my environment? Help appreciated.

    https://wordpress.org/plugins/markdown-on-save-improved/

Viewing 7 replies - 1 through 7 (of 7 total)
  • Thread Starter Needle0

    (@needle0)

    Sorry, forgot to mention an important detail. I use the three tilde syntax (~~~) to open and close the code blocks. Thanks.

    Thread Starter Needle0

    (@needle0)

    Same thing happens with the “4 spaces or 1 tab at beginning of line” syntax.

    Thread Starter Needle0

    (@needle0)

    This is even true with the Markdown functionality in Jetpack.

    Plugin Author Matt Wiebe

    (@mattwiebe)

    Can you publish the original text and converted text on pastebin? Is this on a Multisite blog?

    Thread Starter Needle0

    (@needle0)

    I use plain WordPress, not multisite. I made a test page:
    http://www.heistak.com/mosi-test/

    What I originally typed into as Markdown looked like this:
    http://pastebin.com/WQu9z2gy

    The rendered HTML looks like this:
    http://pastebin.com/tXmbXVf6

    Finally, when I go back to the post editor, the Markdown source has changed into this:
    http://pastebin.com/i8qeyQy8

    FYI, I also tried pasting the same Markdown source into a WordPress.com hosted blog. This one behaves slightly differently, removing the angled-brackets section entirely.
    http://needle0.wordpress.com/2014/01/28/test-post/

    Thread Starter Needle0

    (@needle0)

    I experimented some more. Experiencing some truly bizarre stuff.

    A)
    On my main blog, I kept disabling plugins one by one, until MoSI was the only plugin left enabled. I pasted, previewed and re-saved the post with the markdown source every time, and the post rendered incorrectly every time.

    B)
    I installed a new WordPress instance on my local Mac and tried the same markdown source with MoSI. The brackets rendered correctly!
    I then kept adding plugins to the installation to match my main blog’s plugin setup. I again pasted, previewed and re-saved the post every time, and the post rendered correctly every time.

    About the only other thing I can think of is that the MySQL database encoding for my main blog is set to EUC-JP instead of UTF-8. (I can’t immediately experiment with this one since my webhost only allows one database.)

    Thread Starter Needle0

    (@needle0)

    In the process of experimenting even more, I accidentally blew away all my database tables and had to spend some time recovering from a backup. I took the opportunity to recreate the database in UTF-8 this time, and somehow the capitalization problem seems to have gone away. It could’ve been the encoding, or perhaps just cruft that accumulated in my years-old WP database… but I’m not complaining 🙂

Viewing 7 replies - 1 through 7 (of 7 total)

The topic ‘Capitalization within angled brackets in code blocks are lost’ is closed to new replies.