FeepingCreature
Member
Posted 4 years 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);
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).
Francis Crossen
Member
Posted 3 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?