<commit_before>@if ($post->attachments->count())
@spaceless
<div class="post-attachments attachment-count-{{ $post->attachments->count() }} {{ $post->attachments->count() > 1 ? "attachments-multi" : "attachments-single" }}">
    @foreach ($post->attachments as $attachment)
    @if (!isset($catalog) || !$catalog)
    @if ($attachment->is_deleted)
    <div class="attachment attachment-deleted">
        {!! $attachment->toHtml() !!}
    </div>
    @else
    <div class="attachment attachment-type-{{ $attachment->file->guessExtension() }} {{ $attachment->file->getHtmlClasses() }}" data-widget="attachment" data-file="{{ $attachment->file_id }}" data-thumbnail="{{ $attachment->thumbnail_id }}">
        <a class="attachment-link" href="{!! $attachment->getUrl() !!}" data-download-url="{!! $attachment->getUrl() !!}" data-thumb-url="{!! $attachment->getThumbnailUrl() !!}">
            {!! $attachment->toHtml() !!}
        </a>

        <div class="attachment-details attachment-actions">
            <div class="actions-anchor actions-attachment" data-no-instant>
                <span class="actions-label"><i class="fas fa-angle-down"></i></span>
                <div class="actions">
                    <div class="action">
                        <a href="{{ $attachment->getUnspoilerUrl($board) }}" target="_blank" class="action-link attachment-unspoiler" title="@lang('board.field.unspoiler')">
                            <i class="fas fa-question"></i>&nbsp;@lang('board.field.unspoiler')
                        </a>
                    </div>
                    <div class="action">
                        <a href="{{ $attachment->getSpoilerUrl($board) }}" target="_blank" class="action-link attachment-spoiler" title="@lang('board.field.spoiler')">
                            <i class="fas fa-question"></i>&nbsp;@lang('board.field.spoiler')
                        </a>
                    </div>
                    <div class="action">
                        <a href="{{ $attachment->getRemoveUrl($board) }}" target="_blank" class="action-link attachment-remove" title="@lang('board.field.remove')">
                            <i class="fas fa-remove"></i>&nbsp;@lang('board.field.remove')
                        </a>
                    </div>
                    <div class="action">
                        <a href="{{ route('panel.site.files.show', $attachment->file->hash) }}" target="_blank" class="action-link attachment-moderate" title="@lang('board.action.moderate')">
                            <i class="fas fa-exclamation-triangle"></i>&nbsp;@lang('board.action.moderate')
                        </a>
                    </div>
                </div>
            </div>

            {{-- Note: Strict LTR direct here because this is technical info. --}}
            <a class="attachment-action attachment-download" dir="ltr" target="_blank" href="{!! $attachment->getUrl($board) . "?disposition=attachment" !!}" download="{!! $attachment->getDownloadName() !!}">
                <span class="detail-item detail-download">
                    @if ($attachment->is_spoiler)
                    <span class="detail-item detail-filename filename-spoilers">@lang('board.field.spoilers')</span>
                    @else
                    <span class="detail-item detail-filename filename-cleartext" title="{{ $attachment->filename }}">{{ $attachment->getShortFilename() }}</span>
                    @endif
                </span>
                <br />
                <span class="detail-item detail-filesize">{{ $attachment->file->getHumanFilesize() }}</span>
                <span class="detail-item detail-filedim" title="{{ $attachment->file->getFileDimensions() }}">{{ $attachment->file->getFileDimensions() }}</span>
            </a>
        </div>
    </div>
    @endif
    @else
    <div class="attachment attachment-type-{{ $attachment->file->guessExtension() }}" data-widget="attachment" data-file="{{ $attachment->file_id }}" data-thumbnail="{{ $attachment->thumbnail_id }}">
        <a class="attachment-link" href="{!! $post->getUrl() !!}" data-instant data-download-url="{!! $attachment->getUrl() !!}" data-thumb-url="{!! $attachment->getThumbnailUrl() !!}">
            {!! $attachment->toHtml('auto') !!}
        </a>
    </div>
    @endif
    @endforeach
</div>
@endspaceless
@endif<commit_msg>Attachment links now target new by default.<commit_after>@if ($post->attachments->count())
@spaceless
<div class="post-attachments attachment-count-{{ $post->attachments->count() }} {{ $post->attachments->count() > 1 ? "attachments-multi" : "attachments-single" }}">
    @foreach ($post->attachments as $attachment)
    @if (!isset($catalog) || !$catalog)
    @if ($attachment->is_deleted)
    <div class="attachment attachment-deleted">
        {!! $attachment->toHtml() !!}
    </div>
    @else
    <div class="attachment attachment-type-{{ $attachment->file->guessExtension() }} {{ $attachment->file->getHtmlClasses() }}" data-widget="attachment" data-file="{{ $attachment->file_id }}" data-thumbnail="{{ $attachment->thumbnail_id }}">
        <a class="attachment-link" target="_new" href="{!! $attachment->getUrl() !!}" data-download-url="{!! $attachment->getUrl() !!}" data-thumb-url="{!! $attachment->getThumbnailUrl() !!}">
            {!! $attachment->toHtml() !!}
        </a>

        <div class="attachment-details attachment-actions">
            <div class="actions-anchor actions-attachment" data-no-instant>
                <span class="actions-label"><i class="fas fa-angle-down"></i></span>
                <div class="actions">
                    <div class="action">
                        <a href="{{ $attachment->getUnspoilerUrl($board) }}" target="_blank" class="action-link attachment-unspoiler" title="@lang('board.field.unspoiler')">
                            <i class="fas fa-question"></i>&nbsp;@lang('board.field.unspoiler')
                        </a>
                    </div>
                    <div class="action">
                        <a href="{{ $attachment->getSpoilerUrl($board) }}" target="_blank" class="action-link attachment-spoiler" title="@lang('board.field.spoiler')">
                            <i class="fas fa-question"></i>&nbsp;@lang('board.field.spoiler')
                        </a>
                    </div>
                    <div class="action">
                        <a href="{{ $attachment->getRemoveUrl($board) }}" target="_blank" class="action-link attachment-remove" title="@lang('board.field.remove')">
                            <i class="fas fa-remove"></i>&nbsp;@lang('board.field.remove')
                        </a>
                    </div>
                    <div class="action">
                        <a href="{{ route('panel.site.files.show', $attachment->file->hash) }}" target="_blank" class="action-link attachment-moderate" title="@lang('board.action.moderate')">
                            <i class="fas fa-exclamation-triangle"></i>&nbsp;@lang('board.action.moderate')
                        </a>
                    </div>
                </div>
            </div>

            {{-- Note: Strict LTR direct here because this is technical info. --}}
            <a class="attachment-action attachment-download" dir="ltr" target="_blank" href="{!! $attachment->getUrl($board) . "?disposition=attachment" !!}" download="{!! $attachment->getDownloadName() !!}">
                <span class="detail-item detail-download">
                    @if ($attachment->is_spoiler)
                    <span class="detail-item detail-filename filename-spoilers">@lang('board.field.spoilers')</span>
                    @else
                    <span class="detail-item detail-filename filename-cleartext" title="{{ $attachment->filename }}">{{ $attachment->getShortFilename() }}</span>
                    @endif
                </span>
                <br />
                <span class="detail-item detail-filesize">{{ $attachment->file->getHumanFilesize() }}</span>
                <span class="detail-item detail-filedim" title="{{ $attachment->file->getFileDimensions() }}">{{ $attachment->file->getFileDimensions() }}</span>
            </a>
        </div>
    </div>
    @endif
    @else
    <div class="attachment attachment-type-{{ $attachment->file->guessExtension() }}" data-widget="attachment" data-file="{{ $attachment->file_id }}" data-thumbnail="{{ $attachment->thumbnail_id }}">
        <a class="attachment-link" target="_new" href="{!! $post->getUrl() !!}" data-instant data-download-url="{!! $attachment->getUrl() !!}" data-thumb-url="{!! $attachment->getThumbnailUrl() !!}">
            {!! $attachment->toHtml('auto') !!}
        </a>
    </div>
    @endif
    @endforeach
</div>
@endspaceless
@endif
{'fraction_non_alphanumeric': 0.1919826404751028, 'fraction_numerical': 0.00022841480127912289, 'mean_word_length': 2.37326656394453, 'pattern_counts': {'":': 0, '<': 121, '<?xml version=': 0, '>': 209, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 12, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5216548', 'n_tokens_mistral': 2455, 'n_tokens_neox': 2361, 'n_words': 411}