Support » Plugin: Enlighter - Customizable Syntax Highlighter » Not working when Infinite Scroll is enabled

  • Resolved chupo_cro

    (@chupo_cro)


    Hi,

    as I said in the review it’s the best syntax hightlighting WP plugin that can be found but there is just one small problem – the highlighting is not triggered in the posts page when Infinite Scroll is enabled. If the post is opened separately then everything is OK and when Inifinite Scroll is disabled then syntax highlighting works even in the posts page, but it doesn’t work in theposts page when Infinite Scroll is enabled.

    I believe this could be solved by adding just one or two lines of code to trigger the syntax highlighter when Infinite Scroll is enabled but I don’t know how that could be done.

    The theme is Twenty Sixteen.

    https://wordpress.org/plugins/enlighter/

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

    (@andi-dittrich)

    Hi chupo_cro,

    it’s a more complex use-case… the EnlighterJS Highlighting is initialized on page-load (1-time-event). if you have a plugin which modifies the content dynamically, a re-initialization must be triggered by the third-party-plugin. but maybe there is a workaround

    which “Infinite Scroll” plugin are you using ?

    Hi,

    thank you for the reply. I am using Jetpack’s/Slimpack’s Infinite Scroll as Twenty Sixteen supports it out of the box.

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    Im currently working on a special Jetpack.InfiniteScroll extension for your use-case. i have to run some additional tests and it will be available in the next release (today or tomorrow as beta release on GitHub).

    fortunately Jetpack.InfiniteScroll provides a javascript event which is triggerd on loading additional content – the Enlighter Extension will hook into it and initialize new codeblocks.

    That’s wonderful!! Thank you very much!

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    The experimental Infinite Scroll support is included within v3.0-BETA1 – you can download the development snapshort from GitHub https://github.com/AndiDittrich/WordPress.Enlighter

    a public release may follow in the next few weeks (with other improvements). currently there is a problem with the extension: click/doubleclick events added by EnlighterJS got removed – i’m not shure if it is a bug within jQuery or the Infinite Scroll plugin…

    generally it’s a very bad situtation to use jQuery as well as MooTools on the same page. The next EnlighterJS version will avoid such issues by working standalone without the need of a JS Framework.

    Thank you very much, I’ll check the plugin as soon as I catch time.

    Regards

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    v3.1 is out including the experimental jetPack extension. currently only tested with twentysixteen

    Sorry for the delay, I was busy so I didn’t log in for quite a while. Yes, the extension works very well, the highlighter is now triggered even in the posts page. Thank you very much for your work!

    ps
    Since there is AVR assembly on the list of the built-in languages it would be nice to add Microchop (PIC) assembly highlighting too – as many people use both (PICs & AVRs). Some other suggestions: Z80 & 6502 assembly, PureBasic, AWK scripts and maybe G-code (for CNC).

    Regards

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Not working when Infinite Scroll is enabled’ is closed to new replies.