• I updated to WordPress 5.1 yesterday, and am having trouble adding chunks of code to a new post using Crayon. Here’s the behavior I’m seeing:

    When I click on the <> icon in the editor, I can access the Crayon interface normally. But when I press Add to actually add the chunk of code to the page, it is added to the page at the very top (just after the post’s title), no matter where my cursor was when I invoked Crayon. I can work around this by ensuring that there is other content in the editor both above and below the insertion point for the chunk of code.

    Once I get the code inserted, I don’t get any of the crayon highlighting, bar at the top, color scheme, etc. even though I have all of that selected in the Crayon interface.

    Is there something special I need to do to get this to work in WordPress 5.1?

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Thread Starter kengr

    (@kengr)

    I was able to solve the pasting location issue by revering back to the Classic Editor (using the Classic Editor plugin).

    But even in the classic editor, I’m not getting any of the syntax highlighting, color scheme, or bar at the top.

    Any ideas on how to get this working properly in WP 5.1 would be much appreciated.

    Thread Starter kengr

    (@kengr)

    Since I can’t seem to get this to work, I have temporarily switched from the Crayon Syntax Highlighter to the Enlighter plugin. I don’t like Enlighter as much as Crayon, feature-wise, but it works reliably in WordPress 5.1.

    The page listed at the beginning of this thread is now using Enlighter.

    If you have a way to get Crayon Syntax Highlighter to work reliably in WordPress 5.1, I would certainly be open to switching back to it.

    may this is the problem, open:

    /wp-content/plugins/crayon-syntax-highlighter/crayon_formatter.class.php

    search for these two lines:

    $toolbar_height = $font_size * 1.5 . 'px !important;';
    $info_height = $font_size * 1.4 . 'px !important;';

    change into this:

               $toolbar_height = intval($font_size) * 1.5 . 'px !important;';
               $info_height = intval($font_size) * 1.4 . 'px !important;';

    may this is the problem causing your issue. Maybe not!
    By the way i’m interested on keep alive this plugin.
    I will contact the author or wp guys to know what the best way to do in case as i can. (since i see the plugin is maybe abandoned)
    i will follow with fixes in the while here, where a sticky post will be opened soon about Crayon updates:
    https://www.axew3.com/w3/forums/viewforum.php?f=10

    cheers!

    • This reply was modified 5 years, 8 months ago by axew3.
    Thread Starter kengr

    (@kengr)

    Thanks for your reply.

    Unfortunately, because Crayon conflicted with Enlighter, I couldn’t have them active at the same time. I had to move forward and change all the code chunks in my blog site to use Enlighter, so that it would be usable by my users/customers/visitors. I used up my available time converting everything to Enlighter.

    At this point, I’m going to have to wait for a Crayon version that has already been tested under WordPress 5.1, before I can invest any more time moving back to Crayon and experimenting.

    Ok! on my 5.1 test Crayon work fine now, just in case may apply the above fix, or download ready 5.1 i will follow updating for next coming WP versions and may re-post on forum, whenever necessary.
    as i can

    I will contact the author or wp guys to know what the best way to do in case as i can.

    download Crayon fixed for WP 5 >
    Regards

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Troubles with Crayon since updating to WordPress 5.1’ is closed to new replies.