I am using a flask to make requests and display results in html page in my browser:
@api.route('/matcher', methods=['GET'])
def matcher():
mid = request.args.get('id')
text = get_text(id)
parameter_data = {'enable': ['matcher']}
result_dict = nlu.get_result(text, **parameter_data)
return jsonify(result_dict)
The function get_result returns a dict, something as below:
{
"text": "This is a test",
"log": "log1 <br>log2<br>log3<br>",
"tags": {
"primary_tags": [],
"aux_tags": [],
}
}
I hope the
tag in the filed 'log' will function as a break line when I make a request in my browser, but it seems it isn't interpreted as a html tag 'break line'. There is no break line in the html display.
How can I fix it?
The code to inject
:
doc.log['log'] = '<br>'.join(self.log)