nurugger07 / calliope

An elixir haml parser
Apache License 2.0
198 stars 37 forks source link

Angular string interpolation doesn't always work correctly. #50

Open zonecheung opened 9 years ago

zonecheung commented 9 years ago

Sometimes, when I put an angular string interpolation ( using {{ }} ) in the attribute, for example:

%textarea.form-control(id="{{ journal_entry.id }}" rows=5)

It might generate an invalid HTML like this:

<textarea id="{{" class="form-control" rows="5"></textarea>

While the expected result is like this:

<textarea class="form-control" id="420" rows="5"></textarea>''

However, it doesn't always behave like that, which is confusing, the following generates the correct result:

%a.pull-left.hidden-sm.hidden-xs(ng-hide="show_new_entry_form" ng-href="/user/{{ current_user.username }}/profile")

converted to:

<a class="pull-left hidden-sm hidden-xs" ng-hide="show_new_entry_form" ng-href="/user/helloworld/profile" href="/user/helloworld/profile"></a>

Would really appreciate if it can be fixed, otherwise we need to check our templates back and forth, and convert some lines to regular html to make it work.

TIA, ~ John