I'm using Mailgun's awesome Inbound Routing to parse my incoming emails, remove the HTML and email signatures, which leaves me with the raw body of text.
Below is a small example of what is returned:
{
"stripped-html": "<html><body><div style=\"font-family: Helvetica; font-size: 13px;\">Testing with <b>bold<\/b> and <u>stuff<\/u><br><\/div><div style=\"font-family: Helvetica; font-size: 13px;\"><u><br><\/u><\/div><div style=\"font-family: Helvetica; font-size: 13px;\">:)<\/div> \n <div><div><br><\/div><div>-- <\/div><div>Tim Smith<\/div><div><br><\/div><\/div> \n \n <p style=\"color: #A0A0A8;\"><\/p> \n <div> \n <br><\/div><\/body><\/html>",
"stripped-text": "Testing with bold and stuff\n\n:)",
"stripped-signature": "-- \nTim Smith"
}
What I want to do is take the plain stripped-text
but also replicate basic formatting like bold, italic, and underlined. In this example the word "bold" is bold and the world "stuff" is underlined.
What would be the best way to tackle this?