<commit_before>{% macro render_news(news) %}
    <news id="{{ news.id }}">
        <uparrow class="{{ news.voted == 'up' ? 'voted' : (news.voted == 'down' ? 'disabled' : '') }}">&#9650;</uparrow>

        {% if news_domain(news) %}
            <h2><a href="{{ news.url }}">{{ news.title }}</a></h2>
            <address>at {{ news_domain(news) }}</address>
        {% else %}
            <h2><a href="/news/{{ news.id }}">{{ news.title }}</a></h2>
        {% endif %}

        {% if app.user and app.user.id == news.user_id and news.ctime > (now() - app.db.getOption('news_edit_time')) %}
            <a href="/editnews/{{ news.id }}">[edit]</a>
        {% endif %}

        <downarrow class="{{ news.voted == 'down' ? 'voted' : (news.voted == 'up' ? 'disabled' : '') }}">&#9660;</downarrow>

        <p>
            {{ news.up }} up and {{ news.down }} down,
            posted by <username><a href="/user/{{ news.username }}">{{ news.username }}</a></username>
            {{ time_elapsed(news.ctime) }}
            <a href="/news/{{ news.id }}">{{ news.comments }} comments</a>
        </p>
    </news>
{% endmacro %}

{% macro render_comments(news, tree, parent_id, level) %}
    {% for comment in tree[parent_id] %}
        {% set parents = tree[comment.id] is defined ? tree[comment.id] : [] %}

        {{ _self.render_comment(news, comment, level, parents) }}

        {% if parents %}
            {{ _self.render_comments(news, tree, comment.id, level + 1) }}
        {% endif %}
    {% endfor %}
{% endmacro %}

{% macro render_comment(news, comment, level, parents) %}
    {% set css_indentation = level * app.db.getOption('comment_reply_shift') %}
    {% set user = comment.user %}

    {% if comment.del is not defined or comment.del == false or parents %}
        <comment style="margin-left:{{ css_indentation }}px" id="{{ news.id }}-{{ comment.id }}">
            <avatar><img src="{{ gravatar(user.email) }}"></avatar>
            <info>
                <username><a href="/user/{{ user.username }}">{{ user.username }}</a></username>
                {{ time_elapsed(comment.ctime) }}.
                {% if app.user and comment.topcomment is not defined %}
                    <a href="/reply/{{ news.id }}/{{ comment.id }}" class="reply">reply</a><commit_msg>Fix the visualization of deleted comments.<commit_after>{% macro render_news(news) %}
    <news id="{{ news.id }}">
        <uparrow class="{{ news.voted == 'up' ? 'voted' : (news.voted == 'down' ? 'disabled' : '') }}">&#9650;</uparrow>

        {% if news_domain(news) %}
            <h2><a href="{{ news.url }}">{{ news.title }}</a></h2>
            <address>at {{ news_domain(news) }}</address>
        {% else %}
            <h2><a href="/news/{{ news.id }}">{{ news.title }}</a></h2>
        {% endif %}

        {% if app.user and app.user.id == news.user_id and news.ctime > (now() - app.db.getOption('news_edit_time')) %}
            <a href="/editnews/{{ news.id }}">[edit]</a>
        {% endif %}

        <downarrow class="{{ news.voted == 'down' ? 'voted' : (news.voted == 'up' ? 'disabled' : '') }}">&#9660;</downarrow>

        <p>
            {{ news.up }} up and {{ news.down }} down,
            posted by <username><a href="/user/{{ news.username }}">{{ news.username }}</a></username>
            {{ time_elapsed(news.ctime) }}
            <a href="/news/{{ news.id }}">{{ news.comments }} comments</a>
        </p>
    </news>
{% endmacro %}

{% macro render_comments(news, tree, parent_id, level) %}
    {% for comment in tree[parent_id] %}
        {% set parents = tree[comment.id] is defined ? tree[comment.id] : null %}

        {{ _self.render_comment(news, comment, level, parents) }}

        {% if parents %}
            {{ _self.render_comments(news, tree, comment.id, level + 1) }}
        {% endif %}
    {% endfor %}
{% endmacro %}

{% macro render_comment(news, comment, level, parents) %}
    {% set css_indentation = level * app.db.getOption('comment_reply_shift') %}
    {% set user = comment.user %}

    {% if comment.del is not defined or comment.del == false and parents %}
        <comment style="margin-left:{{ css_indentation }}px" id="{{ news.id }}-{{ comment.id }}">
            <avatar><img src="{{ gravatar(user.email) }}"></avatar>
            <info>
                <username><a href="/user/{{ user.username }}">{{ user.username }}</a></username>
                {{ time_elapsed(comment.ctime) }}.
                {% if app.user and comment.topcomment is not defined %}
                    <a href="/reply/{{ news.id }}/{{ comment.id }}" class="reply">reply</a>
{'fraction_non_alphanumeric': 0.21556233653007847, 'fraction_numerical': 0.005666957279860506, 'mean_word_length': 2.40177909562639, 'pattern_counts': {'":': 0, '<': 77, '<?xml version=': 0, '>': 79, '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': '2235032', 'n_tokens_mistral': 1546, 'n_tokens_neox': 1420, 'n_words': 321}