Skip to content
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

Handle int or str as section level value [CRITICAL] #119

Merged
merged 2 commits into from
Mar 18, 2022

Conversation

TamzinHadasa
Copy link
Contributor

This should fix the critical bug described by @roysmith here. The API parse action is currently giving level as an int, rather than a string as it previously did; however, on pages from before this change it's still treated as a str. I've talked to a dev about this, and it's not yet clear whether this was an intended change, and, if it wasn't, whether it will be reverted. Given all of that, then, an abstract equality comparison seems like the most backward- and forward-compatible solution.

Demo'd on-wiki, test successful

Fixes critical bug described at <https://en.wikipedia.org/w/index.php?diff=1077793462&oldid=1077172445>. The API parse action is currently giving `level` as an int, rather than a string as it previously did; however, on pages from before this change it's still treated as a str. An abstract equality comparison seems like the most backward- and forward-compatible solution.
@TamzinHadasa TamzinHadasa changed the title Make heading-level check abstract, not strict [CRITICAL] Handle int or str as section level value [CRITICAL] Mar 18, 2022
@TamzinHadasa
Copy link
Contributor Author

Ah ok, I see that block needs to be strict. Second commit handles that. On-wiki test. Successful result.

This still fails but that's due to something beyond the scope of what I changed.

@GeneralNotability GeneralNotability merged commit 67d55e1 into GeneralNotability:main Mar 18, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants