• Jon

    (@freshyjon)


    When creating the code via the Insert button, there is no CodeMirror or other sort of syntax highlighting. Also, hitting Tab doesn’t indent code. It just jumps to the OK button.

    Lastly, there doesn’t seem to be a way to edit existing inserts embedded in the editor?

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

    (@andi-dittrich)

    Hi Jon!

    Generally, within the Visual Editor the Code is not highlighted! It is only “marked” as highlighted codeblock. Therefore you can edit it at any time directly within the Editor Pane.
    In case you click into a Enlighter Codeblock (focus) the “Enlighter Edit Button” will appear in the Editor Toolbar on the upper right side. This allows you to change settings like the language for this particular codeblock.

    The tab-button is not functional as like in a “normal” texteditor, because WordPress/TinyMCE are using a plugin called “TabFocus” which modifies the behaviour. As by design i’ve decided to retain this default (and annoying) behaviour. Maybe i can add an optional flag (opt-in) which disables this plugin in a future version.

    best regards, Andi

    Thread Starter Jon

    (@freshyjon)

    Definitely like the idea of adding an optional flag to allow tabbing to work within the code editor. That would at least make up for the lack of syntax highlighting when creating/editing the code. ??

    Sort of was looking for a plugin that would also provide the Code Mirror (syntax highlighting) while actually WRITING the code too (not just viewing) it. But so far, yours seems better than some of the others I’ve looked into.

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    I’m currently working on the tab-indentation feature. a first preview is [available on GitHub](https://github.com/AndiDittrich/WordPress.Enlighter) – but currently limited to add indentation to a single line of code (easiest case ;))
    You can enable this option via “Enlighter Settings -> Editing -> Visual Editor -> Enable Tab Indentation”

    If you like to contribute, i’ve added your feature request to the issue tracker

    Regarding your “Live Highlighting” feature request: its a design decision to use plain text elements in the visual editor. this has a lot of reasons:

    1. The EnlighterJS Core Plugin is not an Editor, only a Highlighter
    2. The Visual Editor (TinyMCE) uses a lot of internal Tweaks to allow WYSIWYG editing – it is nearly impossible to create or integrated a 3rd party Code Editor within it
    3. Workflow: it was originally created to add pasted code from an IDE to a website – no less, no more ??
    4. Usage should be easy as possible with a seemless integration into WordPress – i known there are other Highlighting Plugins out there which are using a separate window to allow code editing with ACE/Cloud9 Editor or similar ones but i don’t like this workflow

    best regards, Andi

    Plugin Author Andi Dittrich

    (@andi-dittrich)

    The Tab-Indentation mode of 3.5-BETA4 should be fully functional (single line, block selection, reverse) – requires a modern webbrowser

    Please try it ??

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘No syntax highlighting when adding via Enlighter Code Insert’ is closed to new replies.