2015-02-23 42 views
1

我一直在使用Jade,我似乎在同一段落中使用混合文本和标签时出现问题。例如:如何在Jade中格式化混合文本?

p 
    | For more information, click 
    a(href="/here") here 
    | to read our documentation. 

在呈现时,漏掉了之间的“点击”和“这里”,所以它看起来像任何空白“欲了解更多信息,请点击这里阅读我们的文档”。

要强制一个空间,我使用 后的 “点击”,如:

p 
    | For more information, click  
    a(href="/here") here 
    | to read our documentation. 

...但感觉不对。有没有更自然的,Jade-y的方式来做到这一点?或者我应该坚持我的HTML非阻塞空间?

回答

0

使用此

p For more information, click #[a(href="/here") here ] to read our documentation. 

#[]是代码玉在字符串或在标签。

+0

呈现为: '

有关更多信息,请单击此处的(href =“/ here”)以阅读我们的文档。

' 我希望'a'成为一个链接。 – 2015-02-24 15:00:08

+0

[documention](http://jade-lang.com/reference/interpolation/)和[github](https://github.com/jadejs/jade/blob/master/docs/views/reference/interpolation。玉)。看看白色的空间! – 2015-02-24 16:05:09