任何有haml经验的人都知道如何在画布上使用它?
%canvas#myCanvas{:width => 1000, :height => 1000, :style => z-index: 2}
haml不喜欢我的z-index我想要haml
时会出错Syntax error on line 131: input.haml:8: syntax error, unexpected ':', expecting ')'
...ght => 1000, :style => z-index: 2)}></canvas>\n <canvas i...
... ^
input.haml:8: unknown regexp options - cava
input.haml:8: syntax error, unexpected $undefined
...vas id='layerCanvas'></canvas>\n </body>\n</html>\n", -2, f...
... ^
input.haml:8: unknown regexp options - htl
input.haml:8: syntax error, unexpected $undefined
...></canvas>\n </body>\n</html>\n", -2, false);;_erbout
... ^
input.haml:8: unterminated string meets end of file
input.haml:8: syntax error, unexpected end-of-input, expecting tSTRING_DEND
...</html>\n", -2, false);;_erbout
... ^
Use --trace for backtrace.
答案 0 :(得分:0)
通过使用html2haml的转换器解决了这个问题。
答案 1 :(得分:0)
属性需要是有效的Ruby。特别是,这是无效的:
:style => z-index: 2
您需要引用值:
:style => "z-index: 2"