title: Groovy MarkupBuilder - not yielding raw text
body: <p>I have the following chunk of code for writing out a series of button elements, containing an icon and text:</p>
  
  <pre><code>def tagcloud = { attrs, body -&gt;
  
      def mb = new MarkupBuilder(out)
  
      mb.ul('class': 'list-inline') {
          def tag = it
          attrs.tags.split(",").each {
              li {
                  button('class': 'btn btn-default', 'type': 'submit') {
                      i('class': 'fa fa-tag', '')
                      mb.yield('test')
                  }
              }   
          }
      }
  }
  </code></pre>
  
  <p>However, I am finding when using the yield function that the markup builder is outputting the yield call as a tag in my html, rather then the raw text:</p>
  
  <pre><code>&lt;li&gt;
      &lt;button class="btn btn-default" type="submit"&gt;
        &lt;i class="fa fa-tag"&gt;&lt;/i&gt;
        &lt;yield&gt;test&lt;/yield&gt;
      &lt;/button&gt;
  &lt;/li&gt;
  </code></pre>
  
  <p>Based on my research, this is the recommended way of doing this: <a href="https://stackoverflow.com/questions/23169/html-using-groovy-markupbuilder-how-do-i-elegantly-mix-tags-and-text">HTML using Groovy MarkupBuilder, how do I elegantly mix tags and text?</a></p>
  
  <p>Does anyone know why this text is being wrapped liked this?</p>
  
  <p>I am using Grails 2.3.8.</p>