我在@snippet.code
中有代码,我想用harsh突出显示:
:harsh
#!harsh theme = lazy
= @snippet.code
但是,这只是突出显示@snippet.code
,因此输出为:
<pre class="lazy"><span class="Keyword">=</span> <span class="Variable"><span class="Variable">@</span>snippet</span>.code
</pre>
如何在生成的代码中使用Harsh?感谢
答案 0 :(得分:0)
您需要打印出@ snippet.code
的内容了解您正在使用的模板引擎会有所帮助。尝试:
:harsh
#!harsh theme = lazy
<%= @snippet.code %>
如果erb在苛刻之前到达代码,这应该有用。