I am struggling with formatting a <pre>
& <code>
tag in my code. The current look is:
<pre><code>somevar = array.join("-")
somevar.split("-")
puts "#{somevar} is cool yay!"
if somevar.nil?
puts 'it's nil!'
end
</code></pre>
I want it to be correctly indented, like this:
I have tried using jQuery's 'trim()' function and 'replace()' method with RegEx patterns such as:
/^\s*/
/\s*$/
/^\s+|\s+$/gi
However, I have not been successful. Can someone please provide guidance on how to achieve the desired formatting? Thank you!