WordPress.org

Ready to get started?Download WordPress

Forums

Enlighter - Customizable Syntax Highlighter
[resolved] Code-indent removed by wordpress editor (13 posts)

  1. zardav
    Member
    Posted 1 month ago #

    Hi!
    There is a topic here:
    http://wordpress.org/support/topic/code-indent-remove-by-wordpress-editor?replies=3
    But when I paste the code in wordpress, the problem not solved.
    Any idea?

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

  2. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    Hi zardav,
    i've tried to paste code into the visual and the text editor. in both cases the indent is not removed. what are you exactly doing and what's your copy-source ?

    best regards, Andi

  3. zardav
    Member
    Posted 1 month ago #

    Format -> Enlighter codeblock -> c#.
    Visual studio -> mark code -> ctrl+c -> back to editor -> ctrl+v -> no indentation, מot even brokenץ
    Thanks!

  4. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    What's happening if you copy the content into notepad ?
    I've tried it with Eclipse and everything works fine..

  5. zardav
    Member
    Posted 1 month ago #

    If I copy the content into notepad the indentation still correct.

  6. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    i've got no idea what's going wrong...but it seems to be a problem with TinyMCE ... EnlighterJS just add's some html attibutes to the editor's pre tag and doesn't process the code within the editor...

    as a workaround you can copy it to notepad -> copy it again -> paste it into wordpress...this works for me in most cases if something gone wrong

  7. zardav
    Member
    Posted 1 month ago #

    OK, thanks. My solution is to combine this plugin for the lighting and WP-SynHighlight to insert code in TinyMCE (with my change - Don't add the tags of synhighlight). I suggest to copy the code-insert dialog to this plugin.

  8. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    Ah ok, great idea! i will implement a "code insert dialog" which avoids such formatting issues!

  9. zardav
    Member
    Posted 1 month ago #

    Thanks! Note that the main features of such one, are to support Tab and Shift-Tab...
    The plugin named above, uses editarea 0.8.1.1.
    Thanks again..

  10. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    An additional editor which supports tab/Shift-Tab/Block-Shifts will follow soon with some other Enlighter specific options...it requires a deep integration into the TinyMCE editor and the documentation is very "holey" ..

    I've just added a simple insert-only dialog (select language + insert code) which should avoid insert-copy formatting issues. if you like you can test it - should work in your case :)

  11. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    I've added the insert-dialog to the current release v2.2 - please tell me if it's working in your case :)

    the tab/shift-tab/block-shift functions will be added later .. directly into the Visual-Editor :)

  12. zardav
    Member
    Posted 1 month ago #

    Very good. I think these functions (tab etc) should be in the insert dialog too.
    The indentation not removed (Congrats!), but not appear exactly as I want, since I copied function with some indentation, that's still with the full indentation in the site (the tab and shift tab functions will solve it, but note that some IDEs like VS actually use spaces and not tabs).
    The Insert Dialog has to include option to choose "inline" or "code-block", no?
    Can you add rtl support? That's means add to all code areas and language choosers an attribute dir="ltr" because in rtl sites that's still rtl and very ugly (try add dir="rtl" to know how it appears in rtl sites)...
    One more thing is the "Toggle RAW Code" button, it's hide few code in some cases, I haven't solution for that...
    I hope to translate the plugin to Hebrew soon.
    Thanks very much!

  13. Andi Dittrich
    Member
    Plugin Author

    Posted 1 month ago #

    Hi zardav,
    maybe i could add an optional checkbox to the insert dialog like "strip indentation offset" which means that the minimal offset which is found will be used as initial position.

    using tabs seems to be a general problem with TinyMCE... i will try to use some other whitespace characters instead.

    and of course, the inline option is missing - sorry for that.

    rtl support should be possible - i will try to add it to the next release (i'm working on some additional themes currently)

    could you provide me an example with the "toggle raw code" problem ? i think it's a bug caused by some other CSS rules for pre tags on your page - maybe i can harden the Enlighter-CSS to avoid such problems.

    thanks for your feedback!
    best regards, Andi

Reply

You must log in to post.

About this Plugin

About this Topic