-
Notifications
You must be signed in to change notification settings - Fork 1
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
wiki: version selector doesn't work in function API pages #8
Comments
Even with a working wrapSections it doesn't seem to do hide the available since tags. function wrapSections () {
var list = document.querySelectorAll('h2');
var wrapper;
for (let element of list) {
wrapper = makeWrapper();
element.parentNode.insertBefore(wrapper, element);
wrapper.appendChild(element);
}
} Not having made the original script, I'm not sure how it works or what would be required to fix it. |
I've been referencing archive.org for how things used to behave - if that change fixes the "removed in" sections which should be hidden then it's better than before at least, but I can continue poking at it to see if I can find the causes of other issues as well. [For reference, I don't have the ability/permissions to update the script on the wiki on my own.] |
Ah, I completely misunderstood the purpose of wrapSections. The reason the code broke is because the no table of contents plugin broke and I'm hiding it with CSS now, and that's the h2 it's jumping to. I notice that there's a bug with functions that have been added and then later removed. For now, they'll be appearing when they shouldn't be, but the main issue has been fixed. |
Thanks! the newMesh page is working as expected for me now. I think those added+removed functions had flaky support with the version picker even when they worked with it. |
Something about this broke again apparently. I tried using the version selector on the newMesh page from the original post and it's not doing anything (using Chrome on Windows, if that matters). I haven't investigated more than that, yet. EDIT: Firefox seems to work. Strange. |
For example on this page https://love2d.org/wiki/love.graphics.newMesh if you select Latest Version in the version selector it should hide the "Available since" tags, and hide the entire variant sections for the removed variants, but it doesn't right now.
I did a bit of debugging (despite not knowing JS or SMW very well) and I think I found at least one problem: this code finds the first h2 and wraps it as well as all its immediate siblings.
In old cached versions of the wiki from before recent upgrades, the h2's were all around the top level of the hierarchy. But now there's one that's a child of a "toctitle" class so I think it's finding that and then exiting the loop since it has no siblings.
Maybe it'll work to change that code to use
document.querySelectorAll
instead of iterating throughdocument.querySelector
's siblings?The text was updated successfully, but these errors were encountered: