我正在使用手动安装的jekyll-swfobject版本。它包含一个液体标签,呈现如下:
def render(context)
output = super
<<-HTML.gsub /^\s+/, '' # remove whitespaces from heredocs
<div id="#{@config[:content_id]}-wrapper" style="width: #{@config[:width]}; height: #{@config[:height]}">
<div id="#{@config[:content_id]}" style="width: 100%; height:100%">#{render_alternative_content(output)}</div>
</div>
<script type="text/javascript">
// <![CDATA[
#{render_flashvars()}
#{render_params()}
#{render_attributes()}
swfobject.embedSWF(
'#{@swf_url}',
'#{@config[:content_id]}',
'100%',
'100%',
'#{@config[:version]}',
#{render_express_install_url()},
flashvars,
params,
attributes,
#{render_callback_function()}
);
// ]]>
</script>
HTML
end
但是,输出javascript由于某种原因而被转义:
<script>
// <![CDATA[
...
swfobject.embedSWF(
'/url.swf',
'flashcontent',
'100%',
'100%',
...
// ]]>
</script>
我假设我需要Django的“mark_safe”的Jekyll / Liquid变体?但是如何?