Better check of allowed TOC location #641
Merged
Conversation
Closed
markdown/extensions/toc.py
Outdated
| @@ -142,22 +142,30 @@ def iterparent(self, root): | |||
| for parent in root.iter(): | |||
| for child in parent: | |||
| yield parent, child | |||
|
|
|||
| def iter_allowed_parent(self, node): | |||
facelessuser
Feb 20, 2018
•
Collaborator
Why did you not just modify iterparent? Now we have iterparent which is no longer used and then iter_allowed_parent. This should be consolidated into one function, and if you have dead code, it should be removed.
Why did you not just modify iterparent? Now we have iterparent which is no longer used and then iter_allowed_parent. This should be consolidated into one function, and if you have dead code, it should be removed.
cbeauchesne
Feb 20, 2018
Author
Contributor
Because it's public, and I was not sure that it's not used anywhere. But if it's not the case, it's better to simply replace it.
Because it's public, and I was not sure that it's not used anywhere. But if it's not the case, it's better to simply replace it.
cbeauchesne
Feb 20, 2018
Author
Contributor
Fixed
Fixed
facelessuser
Feb 20, 2018
Collaborator
If it isn't overriding a function in the base class, it probably isn't used externally.
If it isn't overriding a function in the base class, it probably isn't used externally.
12f2a5d
to
fd99142
|
Should probably add a unittest to ensure this bug isn't regressed in the future. |
fd99142
to
dbd8e88
dbd8e88
to
d74edae
|
@facelessuser : unittests added ! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
These markdown should not raise an exception :
and
Sorry if I miss something, I've tried a "blind" commit.