<commit_before>`import $ from "vendor/jquery"`
`import Em from "vendor/ember"`
`import moment from "vendor/moment"`

Component = Em.Component.extend
    onAnchorClick: Em.on "click", (evt) ->
        target = evt.target

        if target.tagName is "A" and target.target isnt "_blank"
            evt.stopPropagation()
            evt.preventDefault()
            @container.lookup("route:openxpki").sendAjax
                data:
                    page:target.href.split("#")[1].replace /\/openxpki\//, ""
                    target:target.target

    types:
        certstatus: (v) -> "<span class='certstatus-#{(v.value||v.label).toLowerCase()}'>#{v.label}</span>"
        link: (v) -> "<a href='#/openxpki/#{v.page}' target='#{v.target||"modal"}'>#{v.label}</a>"
        extlink: (v) -> "<a href='#{v.page}' target='#{v.target||"_blank"}'>#{v.label}</a>"
        timestamp: (v) -> 
          if v > 0 
            moment.unix(v).utc().format("YYYY-MM-DD HH:mm:ss UTC")
          else
            "---"
        datetime: (v) -> moment().utc(v).format("YYYY-MM-DD HH:mm:ss UTC")
        text: (v) -> v
        code: (v) -> "<code>#{v.replace(/(\r\n|\n|\r)/gm,"<br>")}</code>"
        raw: (v) -> v
        defhash: (v) -> "<dl>#{(for k, w of v then "<dt>#{k}</dt><dd>#{w}</dd>").join ""}</dl>"
        deflist: (v) -> "<dl>#{(for w in v then "<dt>#{w.label}</dt><dd>#{w.value}</dd>").join ""}</dl>"
        ullist: (v) -> "<ul class=\"list-unstyled\">#{(for w in v then "<li>#{w}</li>").join ""}</ul>"
        
    formatedValue: Em.computed "content.format", "content.value", ->
        @get("types")[@get("content.format")||"text"](@get "content.value")

`export default Component`<commit_msg>Sanitize content for triple mustaches.<commit_after>`import $ from "vendor/jquery"`
`import Em from "vendor/ember"`
`import moment from "vendor/moment"`

jQuery.extend jQuery.expr[':'],
    cleanup: (el) ->
        ret = false
        names = (attr.nodeName for attr in el.attributes \
                    when /^on/.test(attr.nodeName) \
                    or /javascript/.test attr.value)
        for name in names
            el.removeAttribute name
        true

Component = Em.Component.extend
    onAnchorClick: Em.on "click", (evt) ->
        target = evt.target

        if target.tagName is "A" and target.target isnt "_blank"
            evt.stopPropagation()
            evt.preventDefault()
            @container.lookup("route:openxpki").sendAjax
                data:
                    page:target.href.split("#")[1].replace /\/openxpki\//, ""
                    target:target.target

    types:
        certstatus: (v) -> "<span class='certstatus-#{(v.value||v.label).toLowerCase()}'>#{v.label}</span>"
        link: (v) -> "<a href='#/openxpki/#{v.page}' target='#{v.target||"modal"}'>#{v.label}</a>"
        extlink: (v) -> "<a href='#{v.page}' target='#{v.target||"_blank"}'>#{v.label}</a>"
        timestamp: (v) ->
          if v > 0
            moment.unix(v).utc().format("YYYY-MM-DD HH:mm:ss UTC")
          else
            "---"
        datetime: (v) -> moment().utc(v).format("YYYY-MM-DD HH:mm:ss UTC")
        text: (v) -> v
        code: (v) -> "<code>#{v.replace(/(\r\n|\n|\r)/gm,"<br>")}</code>"
        raw: (v) -> v
        defhash: (v) -> "<dl>#{(for k, w of v then "<dt>#{k}</dt><dd>#{w}</dd>").join ""}</dl>"
        deflist: (v) -> "<dl>#{(for w in v then "<dt>#{w.label}</dt><dd>#{w.value}</dd>").join ""}</dl>"
        ullist: (v) -> "<ul class=\"list-unstyled\">#{(for w in v then "<li>#{w}</li>").join ""}</ul>"

    formatedValue: Em.computed "content.format", "content.value", ->
        e = @get("types")[@get("content.format")||"text"](@get "content.value")
        $el = $ '<div/>'
        $el
            .html e
            .find ':cleanup'
        return $el.html()


`export default Component`
{'fraction_non_alphanumeric': 0.23218928757150287, 'fraction_numerical': 0.0010400416016640667, 'mean_word_length': 2.2382154882154883, 'pattern_counts': {'":': 0, '<': 54, '<?xml version=': 0, '>': 83, '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': '7247843', 'n_tokens_mistral': 1322, 'n_tokens_neox': 1341, 'n_words': 257}