<FromGitter>
<Blacksmoke16> but whats that code do?
<FromGitter>
<gregoryc> It's a recursive gsub that is generic. Argument 1 is a string, argument 2 is the beginning section (which gets removed), argument 3 is the ending section (which gets removed). The function yields to a block, and the new value is the block's value, surrounded by spaces
<FromGitter>
<gregoryc> Works for string and regexs so far, can be extended easily to other data types
<FromGitter>
<gregoryc> It's a little awkward because I have to use macro conditionals to make it work.
<FromGitter>
<gregoryc> Is there a better way ? :)
<FromGitter>
<Blacksmoke16> quite frankly i still dont know what it does/what the use case is so not sure
<FromGitter>
<gregoryc> It could be used to parse a lot of things, including html and xml
<FromGitter>
<gregoryc> It's very very useful, because it yields
<FromGitter>
<gregoryc> Just as gsub is useful
<FromGitter>
<gregoryc> Can be used to get rid of unwanted markup
<FromGitter>
<gregoryc> Or extended to do something else
ur5us has joined #crystal-lang
irc_user has joined #crystal-lang
wmoxam has joined #crystal-lang
<wmoxam>
Hey, this isn't strictly a crystal question, but I'm looking to recursively render a template in ECR (in order to display a tree). Anyone have experience doing this?