{% load django_bootstrap5 %}
<div class="ck-editor-container form-control p-0{% if 'ck-editor__singleline' in widget.attrs.class %} ck-editor__singleline{% endif %}{% if 'is-valid' in widget.attrs.class %} is-valid{% elif 'is-invalid' in widget.attrs.class %} is-invalid{% endif %}">
<textarea name="{{ widget.name }}" {% include 'django/forms/widgets/attrs.html' %}>{% if widget.value %}{{ widget.value }}{% endif %}</textarea>
    <div class="word-count d-none" id="{{ script_id }}-word-count"></div>
    {% if errors %}
        {% for text in errors %}
            <div class="invalid-feedback">{{ text }}</div>
        {% endfor %}
    {% endif %}
<input type="hidden" id="{{ script_id }}-ck-editor-5-upload-url" data-upload-url="{{ upload_url }}"
       data-upload-file-types="{{ upload_file_types }}" data-csrf_cookie_name="{{ csrf_cookie_name }}">
<span id="{{ script_id }}-span">{{ config|json_script:script_id }}</span>
</div>
