鉴于此示例: https ://support.google.com/adwords/answer/3207306?hl=en&rd=1
如何将“排除代码段故障”部分下列出的代码转换为haml?
我最接近的是:
%script{:type=>"text/javascript"}
:cdata
var google_conversion_id = 123456789;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "AAAAAAAAAAAAAAAAAAA";
var google_conversion_value = 0;
var google_remarketing_only = false;
%script{:type => "text/javascript", :src => "//www.googleadservices.com/pagead/conversion.js"}
%noscript
%div{:style => "display:inline;"}
%img{:height => "1", :width => "1", :style => "border-style:none;", :alt => "", :src => "//www.googleadservices.com/pagead/conversion/123456789/?value=0&label= AAAAAAAAAAAAAAAAAAA&guid=ON&script=0".html_safe}
上面的问题是:cdata
标签产生:
<script type="text/javascript">
<![CDATA[
var google_conversion_id = 123456789;
var google_conversion_language = "en";
var google_conversion_format = "3";
var google_conversion_color = "ffffff";
var google_conversion_label = "AAAAAAAAAAAAAAAAAAA";
var google_conversion_value = 0;
var google_remarketing_only = false;
]]>
</script>
并不是:
<script type="text/javascript">
/* <![CDATA[ */
var google_conversion_id = 123456789;
var google_conversion_language = "en";
var google_conversion_format = "2";
var google_conversion_color = "ffffff";
var google_conversion_label = "AAAAAAAAAAAAAAAAAAA";
var google_conversion_value = 0;
/* ]]> */
</script>
有没有办法明确声明CDATA
标签?还是谷歌对它不那么挑剔?