Title: Code-indent removed by wordpress editor
Last modified: August 21, 2016

---

# Code-indent removed by wordpress editor

 *  Resolved [zardav](https://wordpress.org/support/users/zardav/)
 * (@zardav)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/)
 * Hi!
    There is a topic here: [http://wordpress.org/support/topic/code-indent-remove-by-wordpress-editor?replies=3](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/](https://wordpress.org/plugins/enlighter/)

Viewing 12 replies - 1 through 12 (of 12 total)

 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4972844)
 * 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
 *  Thread Starter [zardav](https://wordpress.org/support/users/zardav/)
 * (@zardav)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4972852)
 * Format -> Enlighter codeblock -> c#.
    Visual studio -> mark code -> ctrl+c ->
   back to editor -> ctrl+v -> no indentation, מot even brokenץ Thanks!
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4972995)
 * What’s happening if you copy the content into notepad ?
    I’ve tried it with Eclipse
   and everything works fine..
 *  Thread Starter [zardav](https://wordpress.org/support/users/zardav/)
 * (@zardav)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4972997)
 * If I copy the content into notepad the indentation still correct.
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973002)
 * 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
 *  Thread Starter [zardav](https://wordpress.org/support/users/zardav/)
 * (@zardav)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973005)
 * 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.
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973006)
 * Ah ok, great idea! i will implement a “code insert dialog” which avoids such 
   formatting issues!
 *  Thread Starter [zardav](https://wordpress.org/support/users/zardav/)
 * (@zardav)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973009)
 * 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](http://www.java2s.com/Code/JavaScript/GUI-Components/editarea0811.htm).
   Thanks again..
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973015)
 * 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 🙂
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973047)
 * 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 🙂
 *  Thread Starter [zardav](https://wordpress.org/support/users/zardav/)
 * (@zardav)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973050)
 * 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!
 *  Plugin Author [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * (@andi-dittrich)
 * [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973057)
 * 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

Viewing 12 replies - 1 through 12 (of 12 total)

The topic ‘Code-indent removed by wordpress editor’ is closed to new replies.

 * ![](https://ps.w.org/enlighter/assets/icon-256x256.png?rev=1215872)
 * [Enlighter - Customizable Syntax Highlighter](https://wordpress.org/plugins/enlighter/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/enlighter/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/enlighter/)
 * [Active Topics](https://wordpress.org/support/plugin/enlighter/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/enlighter/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/enlighter/reviews/)

 * 12 replies
 * 2 participants
 * Last reply from: [Andi Dittrich](https://wordpress.org/support/users/andi-dittrich/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/code-indent-removed-by-wordpress-editor/#post-4973057)
 * Status: resolved