[Plugin: Codecolorer] Be smart about stripping leading whitespace (3 posts)

  1. FeepingCreature
    Posted 7 years ago #

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

    $ diff codecolorer.php.old codecolorer.php
    < $text = trim($text);
    > $text = preg_replace('/^( *\r?\n)+/', '', $text);
    > $text = preg_replace('/\r?\n *$/', '', $text);

  2. kpumuk
    Posted 7 years ago #

    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).

  3. Francis Crossen
    Posted 6 years ago #

    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?

Topic Closed

This topic has been closed to new replies.

About this Topic