title: how to create a strong element inside a p
body: <p>In haml, how do I render the following incredibly basic HTML:</p>
  
  <pre><code>&lt;p&gt;Results found for &lt;strong&gt;search term&lt;/strong&gt;
  </code></pre>
  
  <p>where 'search term' is actually a Ruby variable called <code>@query</code>?</p>
  
  <p>I'm trying the following, </p>
  
  <pre><code>%p results found for &lt;strong&gt;= @query&lt;/strong&gt;
  </code></pre>
  
  <p>But that renders <code>= @query</code> literally. If I try:</p>
  
  <pre><code>%p results found for &lt;strong&gt;
  = @query
  &lt;/strong&gt;
  </code></pre>
  
  <p>then the query term renders correctly, but is on a new line. </p>
  
  <p>Also, I'm wondering if there's a better way to render <code>&lt;strong&gt;</code> in haml, while keeping everything on the same line.</p>
  
  <p>I'm aware of the <a href="http://haml-lang.com/docs/yardoc/file.HAML_REFERENCE.html" rel="nofollow noreferrer">haml documentation</a>, but as far as I can see there isn't an example of using a simple inline Ruby variable. </p>
  
  <p>-----UPDATE-------</p>
  
  <p>The following code works, and shows how to use a variable that's not within tags:     </p>
  
  <pre><code>   %p   
      = @trials_found_count
      results found for
      %strong= @query
  </code></pre>
  
  <p>But I find it really unreadable - it's hard to tell that it renders as just one line of HTML without adding a comment above.</p>
  
  <p>Is there a way I can put all this code on a single line? Or is this just how haml works?</p>