Quote machine tweet quote

Quote machine tweet quote
0.0 0

#1

I want to remove the <p></p> HTML tag that shows it when I click to tweet the quote. I tried a different approach but no one works for me. I really going to appreciate any help without refactoring the code or at least not change the code too much, thanks.
Here are my code https://codepen.io/algenisromero/pen/WGVwQo


#2

QuotesOnDesign likes to give you quotes pre-wrapped in a <p> tag, perhaps because irony is the best demonstration of bad design. A simple call to string.replace() will fix this.

post.content.replace(/\<\/?p\>/g,"")

With that done, you’ll find that your tweet button won’t work as expected. Take a gander at this function for a solution.


#3

Thanks so much for your solution and I see why the button do not work as expected. Your solution do not fix the encode issue when the quote has apostrophes or semicolons, the quote text cut off, you can take a look https://algenisromero.github.io/QuoteMachine-FCC/ and here is the code https://killeen.craigslist.org/ thanks


#4

:slight_smile::smiley: