Skip to content

wiki: version selector doesn't work in function API pages #8

@slime73

Description

@slime73

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 through document.querySelector's siblings?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions