JSFiddle - React, Tailwind, and code Playground

by Eric Howe

HTML

<script src="http://documentcloud.github.com/underscore/underscore-min.js"></script>
<h3>Example1: With Template</h3>
<div id="example1_template"></div>

<script id="template1" type="text/html">
    <%= message.replace(new RegExp('\r?\n', 'g'), '<br />') %>
</script>

CSS

h3{font-weight: bold;margin:10px 0;}

JavaScript

var message = 'Line1\r\n\r\nLine2';

var template1 = _.template($('#template1').html());
$('#example1_template').html(template1({ message: message }));