Formatting error when tweeting a random quote

Formatting error when tweeting a random quote
0

#1

I am having issues when I go to click my tweet button, the random quote will have an unexpected return right before the closing quotations and that some characters such as " ’ " are not being encoded and appear as ’ in the tweet. Has anyone had this issue or have any feedback on how I can go about fixing this problem?

Here is a link to my code pen:

Thanks!


#2
$("#tweet").on("click", function() {
    open(
      `https://twitter.com/intent/tweet?text="${quote}"%0A-${author}`
    );

#3

Thanks that seemed to fix the issue. There still is some inconsistency with the quote function now, but I think it has more to do with the API than the javascript.