Hello Fellow Campers!!
I ran into a slight issue while building my random quote machine. The API that I am using, https://quotesondesign.com/api-v4-0/ , places paragraph tags in its JSON data, specifically around the quote (“content” property). This wasn’t an issue until I wanted to take the quote and tweet it out. When I would send the quote to twitter it would include the “p” tags in the tweet.
To overcome this I stored the data with .replace() using Regex to filter out the “p” tags. However I couldn’t figure out how to remove both the opening and the closing tags in the same .replace() function. To get around this I split the quote into two variables and used a replace function twice- the first to remove the opening tag and the second to remove the closing tag.