0

私はHAMLにかなり慣れていません。レンダリングする方法を誰か説明できますか:

<html itemscope itemtype="http://schema.org/">

問題を引き起こしているのは「アイテムスコープ」です。

私は持っている:

%html{ :itemtype => "http://schema.org"}

マッピングエラーが発生せずに「itemscope」をどこにも追加できないようです。

助けてくれてありがとう!

4

2 に答える 2

1

ブール値として追加し、html5をフォーマットするように指示してみてください。

engine = Haml::Engine.new '%html{:itemscope => true :itemtype => "http://schema.org"}', :format => :html5
puts engine.render

レンダリングする必要があります

<html itemscope itemtype="http://schema.org/">
于 2012-05-01T15:10:54.173 に答える
0

古い質問を再検討すると、必要なのは次のとおりでした。

%html{itemscope: true, itemtype: "http://schema.org"}

そしてそれは生成します:

<html itemscope itemtype="http://schema.org/">
于 2013-09-03T10:04:44.833 に答える