<commit_before>'use strict';

var Vue = require('vue'),
    MarkdownIt = require('markdown-it'),
    twemoji = require('twemoji');

var md = new MarkdownIt({
    breaks: true,
    linkify: true
}).use(require('markdown-it-emoji'))
.use(require('markdown-it-highlightjs'))
.use(require('markdown-it-checkbox'));

md.renderer.rules.emoji = function(token, idx) {
  return twemoji.parse(token[idx].content);
};

Vue.filter('markdown', function (value) {
    if (!value) return '';

    return md.render(value);
});

Vue.filter('prettyDateOffset', function (time) {
    var date = new Date(time),
        diff = (((new Date()).getTime() - date.getTime()) / 1000),
        day_diff = Math.floor(diff / 86400);

    if (isNaN(day_diff) || day_diff < 0)
        return;

    return day_diff === 0 && (
            diff < 60 && 'just now' ||
            diff < 120 && '1 minute ago' ||
            diff < 3600 && Math.floor( diff / 60 ) + ' minutes ago' ||
            diff < 7200 && '1 hour ago' ||
            diff < 86400 && Math.floor( diff / 3600 ) + ' hours ago') ||<commit_msg>Allow html in notes<commit_after>'use strict';

var Vue = require('vue'),
    twemoji = require('twemoji');

var md = require('markdown-it')({
    breaks: true,
    html: true,
    linkify: true
}).use(require('markdown-it-emoji'))
.use(require('markdown-it-highlightjs'))
.use(require('markdown-it-checkbox'));

md.renderer.rules.emoji = function(token, idx) {
  return twemoji.parse(token[idx].content);
};

Vue.filter('markdown', function (value) {
    if (!value) return '';

    return md.render(value);
});

Vue.filter('prettyDateOffset', function (time) {
    var date = new Date(time),
        diff = (((new Date()).getTime() - date.getTime()) / 1000),
        day_diff = Math.floor(diff / 86400);

    if (isNaN(day_diff) || day_diff < 0)
        return;

    return day_diff === 0 && (
            diff < 60 && 'just now' ||
            diff < 120 && '1 minute ago' ||
            diff < 3600 && Math.floor( diff / 60 ) + ' minutes ago' ||
            diff < 7200 && '1 hour ago' ||
            diff < 86400 && Math.floor( diff / 3600 ) + ' hours ago') ||
{'fraction_non_alphanumeric': 0.1821578701541336, 'fraction_numerical': 0.03456328818309201, 'mean_word_length': 2.731707317073171, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6234901', 'n_tokens_mistral': 770, 'n_tokens_neox': 698, 'n_words': 170}