【发布时间】:2013-04-30 11:29:51
【问题描述】:
我在这里看到了这个问题,有些人正在通过评论标签或破坏标签来解决这个问题:
<i><!--
-->t does not work on the first level with tabspace = 2
beside it looks horrible.
<a
>nnoying<
/a> is it not?
我记得好像我见过一些类似的把戏
<a>&dont_put_here_space_please;
tricky ampersand code.
有这样的事吗?
我现在正在使用 jinja2 python 模板引擎。它有一些防止空间的技巧吗?
更新:
借助 jinja2,感谢 dav1d,我能想到的最短方法是:
<a>{% if true -%}
No space in the output before this text.
</a>{% endif -%}
Nor after.
有没有更短的方法?
【问题讨论】:
-
你在想 ?
-
@remyabel: 正好相反 :) 类似 &nosp;
-
你见过this?
-
@dav1d 哦,酷!您能否将其放入答案中以便我接受?
-
好的,添加为答案