-
Notifications
You must be signed in to change notification settings - Fork 263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Implement --invert to remove tags matching selector. #81
base: master
Are you sure you want to change the base?
Conversation
The code I wrote has some sort of bug. Minimal test case:
Should delete both |
Closing as I couldn't figure out what was wrong with my code and no longer need to do this for the project I was working on anyway. |
It seems that once you remove the node in line 90: This is a good feature, I think it'd be a good idea to get the PR reopened. |
On the assumption that this is currently correct but the tests were never updated after the formatter changed. Closes ericchiang#80.
Also, update tests for --number to actually check that flag. Previously they were checking for a '-n' tag inside an 'li' tag, producing the empty string. I don't think this was the intended result.
@Matheus28 Thanks for the hint, I really should have noticed that I was mutating the list while I was iterating over it. I've updated the code to save a list of nodes to be removed and then remove them once they've all been found. |
194bb2d
to
be5dee7
Compare
Also, I added tests. In the process I also updated some existing tests which seemed to be incorrect. See commit messages for details. |
Would be great to see this merged! |
This patch worked fine for me and should really be integrated. |
Why is it not merged yet? its really something very useful imho. |
I merged this into https://github.com/frioux/pup, fyi |
Truly thanks \o/ |
Fixes #74. I've never written any Go before, so I'd appreciate a code review. Marked WIP because of that and also because I want to add tests but haven't looked at the test harness hard enough to figure out how yet.