Forums

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

  1. FeepingCreature
    Member
    Posted 6 months ago #

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

  2. kpumuk
    Member
    Posted 3 months 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).

Reply

You must log in to post.

About this Topic