EnlighterJS / Plugin.Gutenberg

:pencil: Official EnlighterJS Plugin for WordPress Gutenberg Editor
Mozilla Public License 2.0
21 stars 1 forks source link

< (less then) is shown escaped #11

Closed izderadicka closed 5 years ago

izderadicka commented 5 years ago

Gutenberg block (rust or generic) < is shown escaped as &lf; see below

fn ans() -> Option&lt;u32> {
    Some(42)
}

fn main() -> Result&lt;(), String> {
    if 2 > 1 {
    println!("The answer is {:?}", ans());
    }
    Ok(())
}

I do have crayon plugin install if it matters ( and it displays less then correctly in classic block)

AndiDittrich commented 5 years ago

Hi @izderadicka ,

i've tried to reproduce your issue but everything works fine within the testing environment

did you disabled crayon before you've started to use Enlighter ? They are not compatible as mentioned in the FAQ! Crayon will take over the EnlighterJS elements.

WIthout Crayon (EnlighterJS Highlighting) image

With Crayon enabled image

best regards, Andi

izderadicka commented 5 years ago

Oh, I see now, that's bit unfortunate as I'm using crayon for old posts (pre v. 5), so disabling it is not an straightforward option, as it will require updates of old posts. Thanks for explanation - is there any possibility for these two to coexist?

AndiDittrich commented 5 years ago

you have two options:

  1. fix the crayon code that it didn't take over the EnlighterJS elements (it selects all pre blocks)
  2. convert your legacy posts to EnlighterJS codeblocks (manually or by using an automatic filter)