<commit_before>/*global define*/
/*global Showdown*/
define(['underscore', 'marionette', 'text!noteSidebarItemTempl'],
function(_, Marionette, Template){
    'use strict';

    var View = Marionette.ItemView.extend({
        template: _.template(Template),

        initialize: function () {
            this.listenTo(this.model,  'change', this.render);
            this.listenTo(this.model,  'change:trash', this.remove);
            console.log(this.options);
        },

        serializeData: function () {
            return _.extend(this.model.toJSON(), {
                page          : this.options.page,
                shownNotebook : this.shownNotebook
            });
        },

        templateHelpers: function () {
            return {
                getContent: function (text) {
                    var converter = new Showdown.converter();
                    var content = converter.makeHtml(text);
                    content = content.substring(0, 50).replace(/<(?:.|\n)*?>/gm, '');
                    return content;
                },

                getTitle: function (title) {
                    return title.replace(/<(?:.|\n)*?>/gm, '');
                },

                // Generate link
                link: function (id, page, notebook) {
                    var url = '/note/';<commit_msg>pagination bug is fixed<commit_after>/*global define*/
/*global Showdown*/
define(['underscore', 'marionette', 'text!noteSidebarItemTempl'],
function(_, Marionette, Template){
    'use strict';

    var View = Marionette.ItemView.extend({
        template: _.template(Template),

        initialize: function () {
            this.listenTo(this.model,  'change', this.render);
            this.listenTo(this.model,  'change:trash', this.remove);
        },

        serializeData: function () {
            return _.extend(this.model.toJSON(), {
                page          : this.options.page,
                shownNotebook : this.shownNotebook
            });
        },

        templateHelpers: function () {
            return {
                getContent: function (text) {
                    var converter = new Showdown.converter();
                    var content = converter.makeHtml(text);
                    content = content.substring(0, 50).replace(/<(?:.|\n)*?>/gm, '');
                    return content;
                },

                getTitle: function (title) {
                    return title.replace(/<(?:.|\n)*?>/gm, '');
                },

                // Generate link
                link: function (id, page, notebook) {
                    var url = '/note/';
{'fraction_non_alphanumeric': 0.1379703534777651, 'fraction_numerical': 0.002280501710376283, 'mean_word_length': 1.5429951690821255, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4140183', 'n_tokens_mistral': 709, 'n_tokens_neox': 648, 'n_words': 135}