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

Twitter description not encoded correctly #213

Closed
LoveMHz opened this issue Feb 6, 2018 · 3 comments
Closed

Twitter description not encoded correctly #213

LoveMHz opened this issue Feb 6, 2018 · 3 comments
Labels

Comments

@LoveMHz
Copy link

LoveMHz commented Feb 6, 2018

Bug Report or Feature Request (mark with an x)

- [ x ] bug report
- [ ] feature request
- [ ] question

OS and Version?

Linux dustin-ws 4.13.0-32-generic #35-Ubuntu SMP Thu Jan 25 09:13:46 UTC 2018 x86_64 x86_64 x86_64 GNU/Linux

Versions

Angular CLI: 1.6.4
Node: 6.11.5
OS: linux x64
Angular: 5.2.0
... animations, common, compiler, compiler-cli, core, forms
... http, language-service, platform-browser
... platform-browser-dynamic, router

angular/cli: 1.6.4
angular-devkit/build-optimizer: 0.0.38
angular-devkit/core: 0.0.25
angular-devkit/schematics: 0.0.48
ngtools/json-schema: 1.1.0
ngtools/webpack: 1.9.4
schematics/angular: 0.1.13
schematics/schematics: 0.0.13
typescript: 2.5.3
webpack: 3.10.0

"ngx-share/core": "^5.0.0"

Repro steps

<a shareButton="twitter" sbUrl="https://example.com" sbDescription="@LoveMHz #TestTag test #Test">Share on Twitter

The log given by the failure

The Twitter URL gets encoded as "https://twitter.com/intent/tweet?url=https%3A%2F%2Fexample.com&text=@LoveMHz%20#TestTag test #Test"

Which results in the tweet being "@LoveMHz https://example.com"

Desired functionality

The text attribute being properly encoded as "%40LoveMHz%20%23TestTag%20test%20%23Test" and for the tweet to read as "@LoveMHz #TestTag test #Test"

@MurhafSousli
Copy link
Owner

MurhafSousli commented Feb 7, 2018

As you see the encoded text is correct, Twitter does not accept hashtags in the text area, there is a tags input where you can define your tags.

@LoveMHz
Copy link
Author

LoveMHz commented Feb 7, 2018

@MurhafSousli It does appear they support it though. If I manually encode the requested URL then it does appear correctly.

https://twitter.com/intent/tweet?url=https%3A%2F%2Fexample.com&text=%40LoveMHz%20%23TestTag%20test%20%23Test

@MurhafSousli
Copy link
Owner

Ok, then the description needs to be encoded before
here is a workaround until I update

https://stackblitz.com/edit/ngx-sharebuttons-jaakcs?file=app/app.module.ts

@MurhafSousli MurhafSousli reopened this Feb 7, 2018
MurhafSousli added a commit that referenced this issue Feb 8, 2018
Encode special characters in meta tags, closes #213
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants