elapouya / python-docx-template

Use a docx as a jinja2 template
GNU Lesser General Public License v2.1
1.91k stars 378 forks source link

Prevent weird spacing #470

Closed mgcd-jed closed 1 year ago

mgcd-jed commented 1 year ago

Describe your problem

When inserting text into a {{ content }} variable with a return to line, this will happen (with the content inserted being Some text that will be weirdly spaced\r\nSome more text) image How can I fix this behavior ? This weird spacing probably has a name and is a feature rather then a bug, I jsut don't know what it is and how to disable it...

Slarag commented 1 year ago

Check the formatting of the paragraph with the {{ content }} variable. I get this behavior only when I set the alignment of the paragraph to "justified": image

mgcd-jed commented 1 year ago

My bad, I don't know how that got Justified in my model since it wasn't in the file I used as a base. How well, thanks Word :) Have a great day.