How to add  in drupal? I'm using underscorejs function _.template() to render html on client side. I found that in many examples, the templates are placed in some &lt;script type="text/template" id="id"&gt; on the page, and using $('#id') to get the templates. like this:

&lt;script type="text/template" id="id"&gt;
  &lt;div class="form-group row"&gt;
    &lt;label for="nickname" class="col-sm-2 control-label text-right"&gt;nickname&lt;/label&gt;
    &lt;div class="col-sm-10"&gt;&lt;span&gt;&lt;%= data.subscriber.nickname %&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group row"&gt;
    &lt;label for="sex" class="col-sm-2 control-label text-right"&gt;sex&lt;/label&gt;
    &lt;div class="col-sm-10"&gt;&lt;span&gt;&lt;%= data.subscriber.sex %&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
  &lt;div class="form-group row"&gt;
    &lt;label for="country" class="col-sm-2 control-label text-right"&gt;country&lt;/label&gt;
    &lt;div class="col-sm-10"&gt;&lt;span&gt;&lt;%= data.subscriber.country %&gt;&lt;/span&gt;&lt;/div&gt;
  &lt;/div&gt;
&lt;/script&gt;


I try build a block to hold these tags, but drupal will break it, lost some tags eventually.

My solution right now drives me crazy: save the template as one line string or concat multiline strings with \ in js.

I really need a better idea. Thanks.

UPDATE:
I found a better idea, using coffee script raw string. From External template in Underscore
You really shouldn't be putting things like that in a drupal block via the UI anyway because someone with permissions could come along and mess it up and then everything breaks.

You can add/remove/change markup on the page by editing the templates in your theme.

For example you could add your template script tag into the page.tpl.php file of your theme.

Assuming you are using the same template on all pages (or a bunch of pages) or you just want a template on a specific page then this is really straight forward.

If you have more complex requirements you might need a large amount of template overrides or you may want to use some code in template preprocess functions in template.php to make things simpler.

For more information on this see Theming Drupal 6 and 7. There is a lot of info in there.