<commit_before>Object.prototype._is_nil = function (name) {
    const obj = this; // e.g document
    if (obj && obj.$attr) {
        return obj.$attr(name)['$nil?']();
    }
    return true;
};

asciidoctor.Extensions.register(function () {
    this.treeProcessor(function () {
        const self = this;
        self.process(function (parent, reader) {

            if (parent._is_nil("apply-data-line"))
                return parent;

            parent.$find_by().forEach(function (node) {
                if (node && node.$source_location) {
                    if (node.$source_location().lineno) {
                        var nodeName = node.node_name;
                        var lineno = node.$source_location().lineno;
                        node['$add_role']("data-line-" + lineno);
                    }
                }
            });
            return parent;
        });
    });
});<commit_msg>Mark table cell by data-line<commit_after>Object.prototype._is_nil = function (name) {
    const obj = this; // e.g document
    if (obj && obj.$attr) {
        return obj.$attr(name)['$nil?']();
    }
    return true;
};

asciidoctor.Extensions.register(function () {
    this.treeProcessor(function () {
        const self = this;
        const selector = JSON.stringify({
        	traverse_documents: true
        });
        self.process(function (parent, reader) {

            if (parent._is_nil("apply-data-line"))
                return parent;

            parent.$find_by(selector).forEach(function (node) {
                if (node && node.$source_location) {
                    if (node.$source_location().lineno) {
                        var nodeName = node.node_name;
                        var lineno = node.$source_location().lineno;
                        node['$add_role']("data-line-" + lineno);
                    }
                }
            });
            return parent;
        });
    });
});
{'fraction_non_alphanumeric': 0.1376998452810727, 'fraction_numerical': 0.0, 'mean_word_length': 1.5492772667542707, 'pattern_counts': {'":': 0, '<': 3, '<?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': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4027570', 'n_tokens_mistral': 541, 'n_tokens_neox': 517, 'n_words': 97}