Closed poke closed 13 years ago
Okay, is this fix okay? Then you can close this pull request and I'll rebase the commits and open a new pull request (so that the line comments remain).
Yeah, looks fine now. Go ahead, and rebase this and post another pr. Closing this one ;)
Originally created to collect some new plugins I am working on, this branch is now serving as a new feature holder :P
The
{url:X}
replacement parameter works the same as the{num:0}
one but uses the match object created from the plugin'smatch
parameter. It can be useful to use parts from the original URL, for example to resolve local URLs correctly within the plugin (without having to hardcode the address of course).To access the match, I had to store it somewhere in between, and I just did that when testing the URL. So we don't have to rematch the URL again just because we want the match for the replacement. Having the previous match result should be good enough there.
Also I removed the empty check in the
num:
operator, because it doesn't make much sense to not allow an empty result. I can actually think of situations where adding a parameter, that might be empty, would be useful. And at least allowing empty results should not break any previous plugins.Oh, and this pull request also includes the fix I already requested for the 0.9.x branch. I noticed that while testing the
url:
operator when it was combined with a normalnum:
operator.