0

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 :

enter image description here

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 %}
Flo Cp
  • 281
  • 2
  • 13

1 Answers1

0

You would need to use html in your template. I kindly refer to another post where it is somehow a problem which describes yours.

How to format jinja tables

patrickgerard
  • 420
  • 4
  • 9