I have a data which is in the python format, now I am rendering that data to the webpage using the flask in python.
While rendering the data it is treating the new line of python as “n” in my html web page.
Also “its” is coming same as the python data “it’s”.
How can I fix this in my project?
this is the output :
The Magician represents manifestation and using one’s skills and resources to achieve their goals. This card suggests that by focusing on positive thinking and taking action towards improving your health, you can overcome any obstacles or challenges that may come your way.”n”
I have not done anything till now except for creating a function , which is not woking also. this is the code of the function
def clean_text(generated_text_clean):
text = re.sub(r"\'", "'", generated_text_clean)
text = re.sub(r'\"', '"', generated_text_clean)
text = html.unescape(generated_text_clean)
# Convert new line characters to HTML <br> tags
text = generated_text_clean.replace('n', '<br>')
return text
TANVI is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.