yznts / kyoto

Asynchronous frontends with Go
https://pkg.go.dev/github.com/yznts/kyoto/v3
MIT License
651 stars 28 forks source link

Decoding a Base64-encoded component state #124

Closed RowdyHcs closed 2 years ago

RowdyHcs commented 2 years ago

Describe the bug Sometimes, for some reason, component fields result in "-" in the component's state. What provokes atob failure and leads to at least broken actions

To Reproduce UIkit -> TWUI -> AppUINavSidebar Field:

Logo: template.HTML(`<a href="#">
            <img src="https://raw.githubusercontent.com/kyoto-framework/kyoto/master/.docs/.vuepress/public/kyoto.svg" class="mx-auto h-16 w-16 scale-150" />
        </a>`),

Expected behavior Escaping before atob resulting in correct behavior where the component's fields do not affect the operation of the component

Screenshots atob

yznts commented 2 years ago

Replacing "-" to "/" missed before doing atob. We can remove replacing "/" to "-" instead of hacking with replacements.