{"comment":{"created_at":"2011-10-12T13:38:27Z","body":"This is not possible since markdown is processed at compile time.","updated_at":"2011-10-12T13:38:27Z","url":"https://api.github.com/repos/stonean/slim/issues/comments/2379217","id":2379217,"user":{"avatar_url":"https://secure.gravatar.com/avatar/768c4401e9e8dc378a841955a7df728a?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/minad","id":50754,"login":"minad"}},"action":"created","issue":{"number":193,"created_at":"2011-10-11T19:12:21Z","pull_request":{"diff_url":null,"patch_url":null,"html_url":null},"body":"Hello,\r\n\r\nSlim's string interpolation isn't working as expected in the following markdown sub-template:\r\n\r\n```irb\r\n## without indentation on the interpolated content\r\n>> Slim::Template.new(\"bogus_file.slim\"){ \"markdown:\\n\\#{links}\\n  there are [g] and [y]\" }.render(Object.new, :links => \"[g]: http://google.com\\n[y]: http://yahoo.com\\n\")\r\n\"<div>[g]: http:&#47;&#47;google.com\\n[y]: http:&#47;&#47;yahoo.com\\n\\n  there are [g] and [y]</div>\"\r\n\r\n## with proper indentation on the interpolated content\r\n>> Slim::Template.new(\"bogus_file.slim\"){ \"markdown:\\n\\#{links.gsub(/^/, '  ')}\\n  there are [g] and [y]\" }.render(Object.new, :links => \"[g]: http://google.com\\n[y]: http://yahoo.com\\n\")\r\n=> \"<div>  [g]: http:&#47;&#47;google.com\\n  [y]: http:&#47;&#47;yahoo.com\\n\\n  there are [g] and [y]</div>\"\r\n```\r\n\r\nI want the `#{links}` interpolation to be performed on the sub-template processor's input *before* it is given to the sub-template processor (markdown, in this case) for processing.  That should produce the expected output:\r\n\r\n```irb\r\n\r\n>> links = \"[g]: http://google.com\\n[y]: http://yahoo.com\\n\"\r\n=> \"[g]: http://google.com\\n[y]: http://yahoo.com\\n\"\r\n>> Slim::Template.new(\"bogus_file.slim\"){ \"markdown:\\n#{links.gsub(/^/, '  ')}\\n  there are [g] and [y]\" }.render(Object.new)\r\n=> \"<p>there are <a href=\\\"http://google.com\\\">g</a> and <a href=\\\"http://yahoo.com\\\">y</a></p>\\n\"\r\n```\r\n\r\nThanks for your consideration.","comments":1,"title":"string interpolation in sub-template processor input","updated_at":"2011-10-12T13:38:27Z","url":"https://api.github.com/repos/stonean/slim/issues/193","id":1879861,"assignee":null,"milestone":null,"closed_at":"2011-10-12T13:38:27Z","user":{"avatar_url":"https://secure.gravatar.com/avatar/79f9616c279f40ef953f366dcfe38dc8?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","url":"https://api.github.com/users/sunaku","id":9863,"login":"sunaku"},"html_url":"https://github.com/stonean/slim/issues/193","labels":[],"state":"closed"},"legacy":{"issue_id":1879861,"comment_id":2379217}}