Skip to content
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

Some URL-encoded string can't be decoded correctly #918

Closed
cignoir opened this issue Sep 29, 2017 · 5 comments · Fixed by #978
Closed

Some URL-encoded string can't be decoded correctly #918

cignoir opened this issue Sep 29, 2017 · 5 comments · Fixed by #978
Labels
help wanted 🆘 Pull request/issue requires extra help from the community. Check these out if you're new!

Comments

@cignoir
Copy link

cignoir commented Sep 29, 2017

context

URL including Japanese which is URL-encoded by EUC-JP or Shift-JIS can not be decoded correctly in view mode.

b4769cc612e073cd08679db8ee0f58bc

screenshot of Boostnote with developer tool open
https://i.gyazo.com/b3dc7697f51cb2ba8fcebbdeb4022a94.png

environment

  • windows10
  • boostnote v0.8.15

expected

I don't want to be automatically decoded.

more example

This behavior corrupts some of existing URLs.

Paste on boostnote and a web browser for comparison

http://metasearch.osdn.jp/wiki/index.php?Samba%2BLDAP%2Bsmbldap-tools%A4%C7%A5%EF%A1%BC%A5%AF%A5%B0%A5%EB%A1%BC%A5%D7%A4%CE%C5%FD%B9%E7%C7%A7%BE%DA
@kazup01 kazup01 added the help wanted 🆘 Pull request/issue requires extra help from the community. Check these out if you're new! label Sep 29, 2017
@cignoir cignoir changed the title Some URL encoded string can't be decoded correctly Some URL-encoded string can't be decoded correctly Oct 2, 2017
@aquibm
Copy link
Contributor

aquibm commented Oct 14, 2017

Hey @kazup01, I'd love to give this one a go :)

@kazup01
Copy link
Member

kazup01 commented Oct 14, 2017

👍

aquibm added a commit to aquibm/Boostnote that referenced this issue Oct 14, 2017
This PR mitigates BoostIO#918 by retroactively replacing link text decoded by mdurl with the original link.
@aquibm
Copy link
Contributor

aquibm commented Oct 14, 2017

Looks like the artefacts are generated by mdurl's decode function, which is used by linkify-it, which is in turn used by markdown-it to parse links that aren't wrapped in markdown's link syntax.

One way we could get around this weird behaviour would be to retroactively fix the links decoded by mdurl after markdown-it renders the editor content. I've raised #978 to address this issue.

@asmsuechan
Copy link
Contributor

URL including Japanese which is URL-encoded by EUC-JP or Shift-JIS can not be decoded correctly in view mode.

The issue was fixed by #816

@kazup01
Copy link
Member

kazup01 commented Oct 28, 2017

Thanks for your contribution @aquibm !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted 🆘 Pull request/issue requires extra help from the community. Check these out if you're new!
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants