I would like to read my string value in my template HTML with Jinja2 and respect exactly the same space. But, I didn't find a solution to have exactly the whitespace.
And I would like to have this display at the end :
My input :
a = "Test_Compo\n Information : Return Composition with SRI
information of Portfolio\n\n Args :\n dict_data (dict
of str : list) : Default value\n see_url (boolean)
: Default value = False\n see_parameters (boolean)
: Default value = False\n\n"
context['name_class'] = [i for i in a.split('\n') if not i.strip() == '']
My Ouput (In Jinja2):
{% for info_method in Method_Info['name_class'] %}
<h4>{{info_method}}</h4>
{% endfilter %}