Support » Plugin: Enlighter - Customizable Syntax Highlighter » Enlighter Keeps Converting double hyphens (––) to dashes (–)

  • Resolved JojoThonk



    I’m trying to use double hyphens in commands in my posts, but they keep getting converted to dashes.

    I removed the wptexturize filter and they no longer get converted in posts, but inside enlighter code they still get converted.

    This very much affects post quality since users generally copy paste some commands in a rush.

    Can anyone help, please?

    Thank you.

    • This topic was modified 5 months, 1 week ago by JojoThonk.
    • This topic was modified 5 months, 1 week ago by JojoThonk.
Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Andi Dittrich


    Which editing mode did you used ?

    To avoid such issues please use the VisualEditor plugins whenever possible

    Hi. Thanks for the quick reply.

    I am using Classic Editor in Text mode. I’m now trying the Visual Editor but I can’t get it to work. I tried

    The solution that worked was installing and wrapping the double hyphens like [raw]--[/raw].

    Alternatively I used the HTML code for hyphen, like ––

    If I don’t use one of those methods it turns this sudo firewall-cmd --reload into sudo firewall-cmd — reload

    Plugin Author Andi Dittrich


    Which Enlighter editing mode did you used ? Markdown, Shortcodes, HTML ?

    The Visual Editor plugins are created to avoid such issues – everything within is immutable.

    I don’t know if I understand this very well.

    In the WordPress Visual Editor I’m seeing Insert Code and Code Settings are those what you refer to as the plugins? Those are the only thing related to Enlighter that I’m seeing in the Visual Editor. I inserted my codes using Insert Code

    Like this:

    With regard to the editing mode, I don’t know where I’d choose an editing mode in the Visual Editor. I’ve seen Markdown, Shortcodes and HTML in the Editing section of the plugin’s settings – Markdown is Enabled, Shortcodes and Text/RAW are disabled. But I assumed that by inserting code via Insert Code then my code would be independent of those settings.

    Plugin Author Andi Dittrich


    That’s the correct way but you shouldn’t switch between visual and text mode…this may breaks the code.

    I’ve just tried to reproduce the issues but everything works as expected (no transforms are applied) – therefore i would assume that one of your other plugins or theme is altering the content


    Understood. I thought it may have been caused by an Enlighter update, as it did not always behave like this.

    Thank you very much for all your help, patience, and very fast replies! I very much appreciate it.

    I’ll update what’s causing this if I figure it out, for posterity.

    • This reply was modified 5 months, 1 week ago by JojoThonk. Reason: Mentioned I'll update
    Plugin Author Andi Dittrich


    just FYI



    Technically the “Editor Plugins” are just inserting a pre tag with additional EnlighterJS related attributes. WordPress normally excludes pre tags from being filtered – dashes are only transformed in regular paragraphs.

    Therefore i would assume that another plugin or your theme is adding an additional filter to the content.

    I understand. The theme did come with a few plugins that have multiple content formatting related features.

    I had a recording of that post from a few weeks ago when making a video tutorial, and I can confirm that everything was looking good.

    I ran some updates yesterday, and I’m assuming something went wrong there.

    Thanks so much all your help and I hope I didn’t take too much of your time.

Viewing 8 replies - 1 through 8 (of 8 total)
  • You must be logged in to reply to this topic.