Reputation: 141
I have html and javascript code snippets that I want to render on a haml page, how do I do it? I'm looking for something that is similar to the html syntax of <pre><code>. Much thanks.
Upvotes: 2
Views: 1391
Reputation: 4394
You can use :erb
or :javascript
keywords.
%div
:erb
<p>
<a href="#">Test</a>
</p>
<script type="text/javascript">
function foo(){
console.log('foo');
}
foo();
</script>
Or
%div
:erb
<p>
<a href="#">Test</a>
</p>
:javascript
function foo(){
console.log('foo');
}
foo();
Also, you can use raw HTML without indentation
%div
<p>
<a href="#">Test</a>
</p>
Upvotes: 3