Skip to content

Linking to a % method fails #5

@faultyserver

Description

@faultyserver

Example: https://drops.pm/#Integer#%

Going directly to that link will fail to load any documentation. Clicking #% in the sidebar of Integer will not take you to the method documentation.

This happens because % is a special character in URLs, and the browser is likely trying to interpret it as an escape sequence, but fails since there is no data after the character.

The culprit seems to be this line:

let full_name = decodeURIComponent(window.location.hash.replace(/^\#/, ''));

decodeURIComponent is attempting to parse the escape character and failing, causing a JS error and stopping the rest of the execution.

I think decodeURIComponent could probably be taken out, or at least be made optional (i.e., try decoding, but fallback to the raw string if it fails).

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workinggood first issueGood for newcomers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions