Switching between Visual Editor and HTML Editor

  • Unknown's avatar

    I usually write my pages (self-hosted site via wp.org) in HTML mode, and I indent the code in an external text editor in a cascading format to help me read the code.

    However, when I use the desktop application/Wordpress.com editor to edit text, when I switch to the Visual Editor and then switch back to the HTML editor, the indentations have been removed for the most part. Anything that was indented more than 1 ‘level’ is collapsed to no indentation.

    Does anyone know why that happens?

  • Hi there,

    The WordPress.com editor is not designed to preserve whitespace in the HTML view of the editor like that, as it’s not a code editor, but a content editor.

    The only case where whitespace will be preserved is if you’re actually typing source code wrapped in the [code] or [sourcecode] shortcodes, meaning you want the actual code to appear in the published post, and looking at the Jetpack-connected site in your account, that's not the case here.

  • Unknown's avatar

    Ah, okay. Thanks for the swift reply!

  • The topic ‘Switching between Visual Editor and HTML Editor’ is closed to new replies.