Closed dregad closed 1 year ago
Thanks for that PR! :)
Unfortunately, I have the feeling that it reintroduces the bug that was fixed by https://github.com/gturri/nspages/commit/1042ed49fa69b9d80dfae820a41a624f7c0751eb
for instance <nspages -exclude:page1 -exclude:page10>
fails with This namespace does exist :0
with the commit of this PR :-/
I'll have a look
FTR: I think I found a way, with this code
static private function _removeFromMatch($matched, $match){
$matched = trim($matched); // to handle the case of the option "-r" which already matches an extra whitespace
$match = substr(str_replace($matched.' ', ' ', $match.' '), 0, -1);
return substr(str_replace($matched."\n", ' ', $match.' '), 0, -1);
}
I need to test it a bit more though
It seems it works with this approach. I'm not too sure it would really work on Windows, I should try to test it there, but at least it improves the situation already so I'll merge that
Superseded by b18078ae27719cc1c9204cbca63975b6100496ab
Previously, only space was considered. This caused error when the nspages tag spanned multiple lines and there was no trailing space before the newline.
Fixes #153