How to make the address code on one line with TWIG?
问题 I have a TWIG code to display the address of a store. Currently the address is rendered on 3 lines. How to make the address code on one line ? {{ store.address|render|trim|replace({'<br>': ' - '})|striptags|raw }} 回答1: Your are outputting the address inside a <pre> tag. The white-space of the <pre> tag is set to pre by default. See here for more information about this. So you have 2 options Replace the <pre> tag with a <div> <div> Lorem ipsum dolor sit amet </div> Overrule the white-space of