2015-05-11 23 views
0

下面是我的HAML文件中的代碼:如何使haml文件中的句子變成粗體?

= render :partial => _paragraph, 
     :locals => {:content => "It is hot. But something's definitely up."} 

我怎樣才能讓最後一句大膽?

+0

使用正則表達式的原始文本,看看這個答案的http:// stackoverflow.com/questions/21472655/regular-expression-in-haml-html-attribute –

+0

似乎與我的問題沒有關係。 –

+0

這是一個解決方案,使最後一句粗體,但如果你發現更好的東西,對你有好處:) GL –

回答

1

您可以添加標籤的字符串,然後將它們作爲你的段落部分

= render :partial => _paragraph, :locals => {:content => "It's one thing to notice an uptick in appetite if you've been training hard at the gym, or if you're pregnant or PMS-ing. <b>But when you always feel like a bottomless pit for no obvious reason, then something's definitely up.</b>"} 

而且在_paragraph

= raw content 
相關問題