htmlknockout.jshamlrich-internet-application

nested quotes in haml


I'm trying to convert my knockoutJs html code to HAML, trying to achieve something after compilation like:

<div data-bind="attr: { 'data-something': someValue }">...</div>

So I try:

%div{data:{bind:"attr: { 'data-something': someValue }"}}

But using haml_assets 0.1.0 I get:

<div data-bind="attr: { "data-something': someValue }'>...</div>

So my last resort was go back to:

== <div data-bind="attr: { 'data-something': someValue }">...</div>

Is this a bug in HAML, and/or is there a neater way to achive this?


Solution

  • This is an issue on haml_assets 0.1.0. A ticket was created for this: https://github.com/infbio/haml_assets/issues/10

    There is also a better workaround for it until it is fixed:

    %div{data:{bind:'attr: { "data-something": someValue }'}}