Skip to content

Double encoding of anchor tag href #188

Open
@marcelreppi

Description

@marcelreppi

Hey,

I've been using your amazing library to extract links from DOM content in a service worker and noticed that achor tags which, for example, lead to some file which has already encoded space characters in the URL (www.test.com/path%20to%20some%20file.pdf) end up with a broken href because the % character is encoded again (www.test.com/path%2520to%2520some%2520file.pdf).

I have a workaround by just calling decodeURIComponent on the href attribute before processing it but I guess that is not the intended behavior and shouldn't be like that.
I am sure that it's related to #49 and the fix for it here

get href() { return encodeURI(stringAttribute.get(this, 'href')); }

I would guess and hope it's not a complicated fix.

Thanks a lot for your work!

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions