[英]How to make the address code on one line with TWIG?
Your are outputting the address inside a <pre>
tag.您正在输出
<pre>
标签内的地址。 The white-space
of the <pre>
tag is set to pre
by default. <pre>
标签white-space
默认设置为pre
。 See here for more information about this.有关这方面的更多信息,请参见此处。
So you have 2 options所以你有2个选择
<pre>
tag with a <div>
<div>
替换<pre>
标签 <div> Lorem ipsum dolor sit amet </div>
white-space
of the <pre>
with css
css
覆盖<pre>
white-space
pre.spaceless { white-space: normal; }
<pre> Lorem ipsum dolor sit amet </pre> <pre class="spaceless"> Lorem ipsum dolor sit amet </pre>
我不确定,但试试这个
{{ store.address|render|trim|replace({'<br>': ' - ','\n':' ', '\r':' '})|striptags|raw }}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.