WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Codecolorer] Be smart about stripping leading whitespace

[Plugin: Codecolorer] Be smart about stripping leading whitespace

  • Remove leading and trailing empty lines, without removing leading whitespace on the first actual line.

    $ diff codecolorer.php.old codecolorer.php
    220c220,221
    < $text = trim($text);

    > $text = preg_replace(‘/^( *\r?\n)+/’, ”, $text);
    > $text = preg_replace(‘/\r?\n *$/’, ”, $text);

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thank you for your suggestion. Implemented in version 0.8.3. Could you send me a link to add it to changelog near your name? (and also your name, if FeepingCreature is not meet your requirements).

    Great plugin thanks…

    I’m having a problem with whitespace.

    I used [ ccenl_PHP][/ccenl_PHP] and copied some code in. However if I switch from the ‘Visual’ editor to ‘HTML’ and back to ‘Visual’ the leading whitespace in front of each line is removed.

    This is affecting my indentation.

    Is it me, a feature or a bug?

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘[Plugin: Codecolorer] Be smart about stripping leading whitespace’ is closed to new replies.