• Hello,
    I have like 1000 code snippets implemented with Crayon Syntax Highlighter, but it seems like the developer abandoned the project.
    Is there an easy way to do that or do I have to replace every snippet one by one?

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author Andi Dittrich

    (@andi-dittrich)

    you can try out the compatibility mode added to the latest release.
    another option is to create a database dump and replace the crayon snippets via a regular expression (offline).

    Thread Starter flizzywp

    (@flizzywp)

    Hey, I just realized that when I activate your plugin, my “Page scroll to id” plugin stops working.

    On this page I use this scroll to id menu:
    https://codinginflow.com/tutorials/android

    and when I activate your plugin and click a link, nothing happens. Any idea why?

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    is it javascript based ? in this case it can be an incompatibility with MooTools which is still used by EnlighterJS. It should throw some js errors in the console

    Thread Starter flizzywp

    (@flizzywp)

    I have no idea how to find that out. Does that mean I can’t use this plugin?

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    try&error ??
    activate Enlighter on your test-site (not production..) and open the browsers console – or post the link.

    in case one of your existing plugins (like your sticky nav) uses old, deprecated jQuery code or weak javascript you are currently unable to run Enlighter on your site without modifications.

    the next major Enlighter release will remove MooTools to avoid such compatibility issues with legacy-style jquery plugins..

    Thread Starter flizzywp

    (@flizzywp)

    Thank you. Is there a timeline for that update?

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    not really..

    Thread Starter flizzywp

    (@flizzywp)

    Has this been updated yet? I am still using Crayon.

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    no…a dedicated crayon-compatibility mode is projected for Enlighter 4.1. currently the Gutenberg plugin as well as the plugin refactoring and EnlighterJS 3.0 integration have a much higher priority.

    maybe you should consider using a regular expression within a database dump to convert .

    btw. an experimental EnlighterJS 3.0 integration is available which fixes most of the javascript compatibility issues. https://github.com/EnlighterJS/experiments/tree/master/wp-enlighterjs3-compat

    Thread Starter flizzywp

    (@flizzywp)

    Converting is not the problem, I will do that manually. The not working “page scroll to id” plugin is my problem.

    It could be easy if Crayon did not make a mess of HTML tags. Empty spaces in code without any logic. Then not only one empty space, randomly, but 2, 3, and even 4. Means for each converting operation you have to do 3 more. But OK, a bit of free time and now my non-public website with developing snippets looks very nice and modern.

    Developer of Crayon moved from WP to another platform, so there is nothing to wait. Move on.

    Use this, helps a lot. Better than any installable plugin.

    https://interconnectit.com/products/search-and-replace-for-wordpress-databases/

    Here is help code to make you move faster. Push this via Interconnect script, and repeat for each Crayon line with 1, 2, 3, or maybe even 4 empty spaces after decode:true”

    <pre class="lang:php decode:true">
    <pre class="lang:css decode:true">
    <pre class="lang:default decode:true">
    <pre class="lang:js decode:true">
    
    <pre class="EnlighterJSRAW" data-enlighter-language="php" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="true" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="" style="display: none;">
    
    <pre class="EnlighterJSRAW" data-enlighter-language="css" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="true" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="" style="display: none;">
    
    <pre class="EnlighterJSRAW" data-enlighter-language="generic" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="true" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="" style="display: none;">
    
    <pre class="EnlighterJSRAW" data-enlighter-language="js" data-enlighter-theme="" data-enlighter-highlight="" data-enlighter-linenumbers="true" data-enlighter-lineoffset="" data-enlighter-title="" data-enlighter-group="" style="display: none;">
    • This reply was modified 6 years, 2 months ago by Stagger Lee.
    • This reply was modified 6 years, 2 months ago by Stagger Lee.
    • This reply was modified 6 years, 2 months ago by Stagger Lee.
    • This reply was modified 6 years, 2 months ago by Stagger Lee.

    This display:none will hide snippets in backend, Gutenberg editor.
    For this I use custom backend CSS file.

    – On front-end everything looks nice and good.
    – Backend is a bit different story.

    If we assume all of us will move to Gutenberg soon or later. And of course Enlighter plugin is not magic and cannot mess with converting blocks in database on its own, means need human intervention for each Post and block.
    I decided for lack of time to leave it as it is in editor. When I need to edit one Post I will convert blocks and make Enlighter blocks in order.

    But, to do this snippets need to be visible. (Remember we just hide them with display:none in mandatory Enlighter HTML tags).
    When visiting a Post, and need for edit is there, of course you have to see snippet, to be able to work with it and convert it to Enlightner block.

    I use custom backend CSS file. But you can use your own functions snippet:

    function my_custom_backend_css() {
     echo '<style>
      .EnlighterJSRAW {display:block !important;}
     </style>';
    }
    add_action('admin_head', 'my_custom_backend_css');
    Thread Starter flizzywp

    (@flizzywp)

    Again, my problem is not replacing Crayon, my problem is that Enlighter messes with my page scroll to id plugin

    Edit:
    Looks like this has been fixed now. However, the inability to use Enlighter and Crayon at the same time makes it impossible for me to switch, because I want to transfer each post manually over a couple days.

    • This reply was modified 6 years, 2 months ago by flizzywp.
Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘I want to replace Crayon’ is closed to new replies.