# How not to parse some parts of templates

**URL:** <https://discourse.gohugo.io/t/how-not-to-parse-some-parts-of-templates/12007>\
**Category:** support\
**Created:** [May 16, 2018, 12:26pm UTC](https://discourse.gohugo.io/t/how-not-to-parse-some-parts-of-templates/12007 "2018-05-16T12:26:11Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Robert\_Smol](https://avatars.discourse-cdn.com/v4/letter/r/ecc23a/32.png) [@Robert\_Smol](https://discourse.gohugo.io/u/Robert_Smol)\
**Post date:** [May 16, 2018, 12:26pm UTC](https://discourse.gohugo.io/t/how-not-to-parse-some-parts-of-templates/12007/1 "2018-05-16T12:26:11Z")

</div>

Hi, I am trying to implement search with algolia and I would like to render `allItems` template based on script inserted in the html.

Hugo fails to compile my template, as it tries to interpret it as hugo template (usage of `{{#hits}`).

This is inside my `partial/search.html`

```auto
<script type="text/html" id="hits-template">
  <table class="table table-striped table-condensed">
    <thead>
      <tr><th>name</th><th>brand</th><th>price</th></tr>
    </thead>
    <tbody>
    {{#hits}}
      <tr><td><a href="#hit-{{objectID}}">{{section}}</a></td><td>{{title}}</td><td>{{url}}</td></tr>
    {{/hits}}
    </tbody>
  </table>
</script>

```

This is my JS

```auto
search.addWidget(
    instantsearch.widgets.hits({
      container: '#hits',
      templates: {
          empty: 'No results',
          allItems: document.getElementById('hits-template').innerHTML // <-- importing the template which is written in mustache 

        }
    })

```

It there a way to tell Hugo to not parse some parts of temple?

---

<div class="post-metadata">

**Author:** ![maiki](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/maiki/32/16384_2.png) [@maiki](https://discourse.gohugo.io/u/maiki)\
**Post date:** [May 17, 2018, 10:28pm UTC](https://discourse.gohugo.io/t/how-not-to-parse-some-parts-of-templates/12007/2 "2018-05-17T22:28:05Z")

</div>

Pass certain parts through a function like [`safeHTML`](https://gohugo.io/functions/safehtml/). There are a lot of functions, so read through them and search the forums for similar questions, there are a lot of examples.
