I have a flask app that returns a template with dynamically generated text. I want to bold specific words in the text variable based on a list variable that is also dynamically generated.
Lets say my two variables are as below
text = "Stephen went to the park on Tuesday with Sarah.
Stephen couldn't go to my birthday party."
list=['Stephen', 'Sarah', 'Tuesday']
desired html output: Stephen went to the park on Tuesday with Sarah. Stephen couldn't go to my birthday party.
Im stumped with how to approach a problem like this, any help or direction will be much appreciated.
Edit: Python code
return render_template('results.html', ctext=boldened_text)
Html code
<h6>Your Text was</h6>
<div class="alert alert-info" role="alert"><p>{{ctext}}</p></div>