On 12/28/06, <b class="gmail_sendername">Ed Howland</b> <<a href="mailto:ed.howland@gmail.com">ed.howland@gmail.com</a>> wrote:<div><span class="gmail_quote"></span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi all.<br><br>I just confirmed this issue with mv:attr<br><br>The directive help page says that you can use #{} to create an erb in<br>the attribute value. This works only somewhat.<br><br>E.g<br><div mv:attr=":id => #{kase_id}" />
<br>...becomes...<br> <div id="<%= kase_id %>" /><br><br><div mv:attr=":id => #{kase_id 1}" /><br>...becomes...<br> <div id="<%= kase_id 1 %>" /><br><br>But
<br><div mv:attr=":id => #{kase_id 1, 2}" /><br>...becomes...<br> <div /><br><br>And it matters not if you use parens on the helper<br><div mv:attr=":id => #{kase_id(1}" /><br>
...becomes...<br> <div id="<%= kase_id(1) %>" /><br>But<br><div mv:attr=":id => #{kase_id(1,2)}" /><br>...becomes...<br> <div /><br><br>This happens after the first parameter to any helper function (2, 3,
<br>... n parameters.)<br><br>Ed</blockquote><div><br><br></div></div>I have found and fixed the issue. It had to do with simplistic logic in the parsing using regular expressions. I enhanced AttrStringParser and changed mv:attr to use that instead. AttrStringParser takes nesting and more things into consideration so it doesn't split prematurely on the comma. I added some test cases to verify.
<br><br>Also I added mv:select to the alphabetic list of directives on the bottom of the directives.html page which you mentioned was missing.<br><br>Since this was such a small fix and there are a few other things I would like to put in, I am going to hold off on pushing out a
0.3.2 release but will email you the <a href="http://0.3.1.1">0.3.1.1</a> gems in a followup email. The code is checked into the trunk. <br><br>Thanks,<br><br>Jeff<br><br><br>