<commit_before>var mustache = require('mustache')
mustache.tags = '% %'

function render (template, view) {
  var KEYWORD_REGEX = /%(asset_name_linked|asset_short_name_linked)\b/g

  var _template = template.replace(KEYWORD_REGEX, '%&$1')
  var _view = {
    asset_name_linked: function nameLinked () {
      if (view.name && view.href) {
        return '<a href="' + view.href + '">' + view.name + '</a>'
      }
    },
    asset_short_name_linked: function shortNameLinked () {
      if (view.short_name && view.href) {
        return '<a href="' + view.href + '">' + view.short_name + '</a>'
      }
    }
  }

  var keys = Object.keys(view)

  for (var i = 0, key; i < keys.length; i++) {
    key = keys[i]
    _view['asset_' + key] = view[key]
  }

  return mustache.render(_template, _view)
}

exports.render = render<commit_msg>Update API to expose: render, parse, and clearCache methods<commit_after>var mustache = require('mustache')
var defaultWriter = new mustache.Writer()

mustache.tags = '% %'

function unescapeKeywords (template) {
  var KEYWORD_REGEX = /%(asset_name_linked|asset_short_name_linked)\b/g
  return template.replace(KEYWORD_REGEX, '%&$1')
}

exports.clearCache = function clearCache () {
  return defaultWriter.clearCache()
}

exports.parse = function parse (template, tags) {
  return defaultWriter.parse(unescapeKeywords(template), tags)
}

exports.render = function render (template, view, partials) {
  var _view = {
    asset_name_linked: function nameLinked () {
      if (view.name && view.href) {
        return '<a href="' + view.href + '">' + view.name + '</a>'
      }
    },
    asset_short_name_linked: function shortNameLinked () {
      if (view.short_name && view.href) {
        return '<a href="' + view.href + '">' + view.short_name + '</a>'
      }
    }
  }

  var keys = Object.keys(view)

  for (var i = 0, key; i < keys.length; i++) {
    key = keys[i]
    _view['asset_' + key] = view[key]
  }

  return defaultWriter.render(unescapeKeywords(template), _view, partials)
}
{'fraction_non_alphanumeric': 0.15597235932872655, 'fraction_numerical': 0.0019743336623889436, 'mean_word_length': 3.3591397849462368, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6728379', 'n_tokens_mistral': 698, 'n_tokens_neox': 682, 'n_words': 151}