Paste twitter string from url?

So, I have a script as of now: popup (" https://twitter.com/intent/tweet?text= " + greeting + poem + "- & url =" + siteURL, 704, 260);

"Poem" is a haiku, and I would like it to be like this: line 1 line2 line3

not line 1 // line 2 // line 3, which it is. I tried inserting things like \ n there to no avail. The "poem" is built simply as line1 + "//" + line2 ...

+6
source share
2 answers

As you may have guessed, newlines are not displayed in URLs.
Using a random shielding mechanism will not do you any good; you need to URL encode the new line:

https://twitter.com/intent/tweet?text=abc%0adef

+13
source


 Creates a line break on Twitter if you submit it from an HTML form. You would need to remove the spaces in the number of characters, I could not figure out how to make the answer not jump to a new line. Ironic warning

+2
source

Source: https://habr.com/ru/post/956584/


All Articles