jeudi 22 octobre 2020

Not sure how to convert this type of text content to valid HTML in Ruby view

I'm not sure exactly what this type of text is called but I am having a hard time getting to convert to valid HTML. Here is an example string

\ufffd\u0004\ufffd{\u003Cp\u003E\u003Ca href=\"https://magazine.com/lifestyle/grooming/url-of-article\"\u003E\u003Cimg src=\"Vp\u0000pwp-content/uploads/2020/08/Ph\u0005x\ufffd(\u0001.jpg\"\u003E\u003C/a\u003E\u003C/p\u003ELegend has it, Ernest Hemmingway once emerged from the Ugandan jungle after surviving two plane crashes brandishing a bunch of bananas and a bottle of gin. With a poorly bandaged arm, he reportedly quipped with a wry smile \ufffd\ufffd\ufffdMy luck, she is running very good.\ufffd\ufffd\ufffd [\ufffd\ufffd\ufffd]\u003Cbr\u003E\u003Cp\u003EVisit \u003C\ufffd\ufffd\u0001\ufffd\ufffd\u0001(Magazine!\ufffdX for the full post.\u003C/p\u003E"

I need to convert the output to be valid HTML. I can remove everything and make it readable text, but I need it to also contain the HTML elements.

Aucun commentaire:

Enregistrer un commentaire