├── .editorconfig
├── .github
└── workflows
│ └── tests.yml
├── .gitignore
├── .pre-commit-config.yaml
├── .readthedocs.yaml
├── CHANGELOG.rst
├── LICENSE
├── README.rst
├── biome.json
├── django_prose_editor
├── .gitignore
├── __init__.py
├── apps.py
├── checks.py
├── config.py
├── fields.py
├── locale
│ └── de
│ │ └── LC_MESSAGES
│ │ ├── django.mo
│ │ ├── django.po
│ │ ├── djangojs.mo
│ │ └── djangojs.po
├── sanitized.py
├── static
│ └── django_prose_editor
│ │ ├── configurable.js
│ │ ├── default.js
│ │ ├── editor.css
│ │ ├── editor.css.map
│ │ ├── editor.js
│ │ ├── editor.js.map
│ │ ├── material-icons.css
│ │ ├── material-icons.woff2
│ │ ├── overrides.css
│ │ └── overrides.css.map
└── widgets.py
├── docs
├── Makefile
├── bundlers.rst
├── changelog.rst
├── conf.py
├── configuration.rst
├── custom_extensions.rst
├── development.rst
├── forms.rst
├── index.rst
├── installation.rst
├── make.bat
├── requirements.txt
└── system_checks.rst
├── package.json
├── postcss.config.js
├── pyproject.toml
├── rslib.config.mjs
├── src
├── editor.css
├── editor.js
├── figure.js
├── fullscreen.js
├── history.js
├── horizontalRule.js
├── html.js
├── link.js
├── locale
├── menu.js
├── nospellcheck.js
├── orderedList.js
├── overrides.css
├── pm.js
├── table.js
├── typographic.js
├── utils.js
└── utils
│ └── canInsertNode.js
├── tests
├── conftest.py
├── manage.py
└── testapp
│ ├── __init__.py
│ ├── admin.py
│ ├── models.py
│ ├── settings.py
│ ├── static
│ └── testapp
│ │ └── blue-bold.js
│ ├── templates
│ └── editor.html
│ ├── test_checks.py
│ ├── test_config.py
│ ├── test_configurable.py
│ ├── test_editor_destroy.py
│ ├── test_form_field.py
│ ├── test_prose_editor.py
│ ├── test_prose_editor_e2e.py
│ └── urls.py
├── tox.ini
├── update.sh
└── yarn.lock
/.editorconfig:
--------------------------------------------------------------------------------
1 | # top-most EditorConfig file
2 | root = true
3 |
4 | [*]
5 | end_of_line = lf
6 | insert_final_newline = true
7 | charset = utf-8
8 | trim_trailing_whitespace = true
9 | indent_style = space
10 | indent_size = 2
11 |
12 | [*.py]
13 | indent_size = 4
14 |
--------------------------------------------------------------------------------
/.github/workflows/tests.yml:
--------------------------------------------------------------------------------
1 | name: Tests
2 |
3 | on:
4 | push:
5 | branches:
6 | - main
7 | pull_request:
8 |
9 | jobs:
10 | tests:
11 | name: Python ${{ matrix.python-version }}
12 | runs-on: ubuntu-latest
13 | strategy:
14 | fail-fast: false
15 | matrix:
16 | python-version:
17 | - '3.10'
18 | - '3.12'
19 | - '3.13'
20 |
21 | steps:
22 | - uses: actions/checkout@v4
23 | - name: Set up Python ${{ matrix.python-version }}
24 | uses: actions/setup-python@v5
25 | with:
26 | python-version: ${{ matrix.python-version }}
27 | - name: Install dependencies
28 | run: |
29 | python -m pip install --upgrade pip tox pytest-playwright
30 |
31 | # Install playwright system dependencies
32 | - name: Install Playwright browsers
33 | run: |
34 | playwright install --with-deps chromium
35 |
36 | - name: Run tox targets for ${{ matrix.python-version }}
37 | run: |
38 | ENV_PREFIX=$(tr -C -d "0-9" <<< "${{ matrix.python-version }}")
39 | TOXENV=$(tox --listenvs | grep "^py$ENV_PREFIX" | tr '\n' ',') python -m tox
40 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | *~
2 | \#*#
3 | /build
4 | /.bundle
5 | .coverage
6 | /data.db
7 | /dist
8 | .DS_Store
9 | /dump.rdb
10 | *.egg-info
11 | /.env
12 | /htdocs/e
13 | /.idea
14 | /log
15 | /media
16 | /node_modules
17 | *.pyc
18 | /static
19 | .*.sw*
20 | /tmp
21 | .tox
22 | /vendor
23 | /venv
24 | /.vscode
25 | yarn-error.log
26 | build
27 | test-results
28 | django_prose_editor/static/django_prose_editor/overrides.js
29 |
--------------------------------------------------------------------------------
/.pre-commit-config.yaml:
--------------------------------------------------------------------------------
1 | exclude: ".yarn/|yarn.lock|\\.min\\.(css|js)$|django_prose_editor/editor.*|django_prose_editor/overrides.*"
2 | repos:
3 | - repo: https://github.com/pre-commit/pre-commit-hooks
4 | rev: v5.0.0
5 | hooks:
6 | - id: check-added-large-files
7 | - id: check-builtin-literals
8 | - id: check-executables-have-shebangs
9 | - id: check-merge-conflict
10 | - id: check-toml
11 | - id: check-yaml
12 | - id: detect-private-key
13 | - id: end-of-file-fixer
14 | - id: mixed-line-ending
15 | - id: trailing-whitespace
16 | - repo: https://github.com/adamchainz/django-upgrade
17 | rev: 1.25.0
18 | hooks:
19 | - id: django-upgrade
20 | args: [--target-version, "4.2"]
21 | - repo: https://github.com/astral-sh/ruff-pre-commit
22 | rev: "v0.11.11"
23 | hooks:
24 | - id: ruff-check
25 | args: [--unsafe-fixes]
26 | - id: ruff-format
27 | - repo: https://github.com/biomejs/pre-commit
28 | rev: "v2.0.0-beta.5"
29 | hooks:
30 | - id: biome-check
31 | args: [--unsafe]
32 | exclude: "static"
33 | - repo: https://github.com/tox-dev/pyproject-fmt
34 | rev: v2.6.0
35 | hooks:
36 | - id: pyproject-fmt
37 | - repo: https://github.com/abravalheri/validate-pyproject
38 | rev: v0.24.1
39 | hooks:
40 | - id: validate-pyproject
41 |
--------------------------------------------------------------------------------
/.readthedocs.yaml:
--------------------------------------------------------------------------------
1 | # Read the Docs configuration file
2 | # See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
3 |
4 | version: 2
5 |
6 | build:
7 | os: ubuntu-24.04
8 | tools:
9 | python: "3.11"
10 |
11 | sphinx:
12 | configuration: docs/conf.py
13 |
14 | python:
15 | install:
16 | - requirements: docs/requirements.txt
17 |
--------------------------------------------------------------------------------
/CHANGELOG.rst:
--------------------------------------------------------------------------------
1 | Change log
2 | ==========
3 |
4 | Next version
5 | ~~~~~~~~~~~~
6 |
7 | - Switched from `esbuild `__ to
8 | `rslib `__. Bundles are smaller and I'm a heavy
9 | user of rspack anyway.
10 |
11 |
12 | 0.12 (2025-05-12)
13 | ~~~~~~~~~~~~~~~~~
14 |
15 | - Updated the Tiptap version to the 3.0 beta to avoid problems with extensions
16 | sharing storage over multiple editor instances.
17 | - Fixed the menu to not run commands on click when the command is disabled.
18 | - Changed the ``addLink`` command to not do anything if the selection is empty
19 | or if the selection isn't inside a link mark currently.
20 | - Fixed the title attribute functionality of link marks. Titles have been
21 | inadvertently broken since 0.10 because I missed the fact that the Tiptap
22 | link extension doesn't define the attribute in the schema.
23 | - Changed the ordered list menu button to disable itself when an ordered list
24 | cannot be inserted.
25 | - Updated the figure menu button to actually check whether figures can be
26 | inserted or not. Same for the horizontal rule menu button.
27 | - Added styles to selected nodes so that e.g. selected horizontal rules are
28 | shown as such.
29 | - Started including source maps again.
30 | - Convert textareas to use autogrow.
31 | - Changed the prose editor dialog to use ``div.prose-editor-dialog-field``
32 | elements to wrap inputs and their labels instead of paragraphs.
33 | - Allowed callable default values in the ``updateAttrsDialog``.
34 |
35 |
36 | 0.11 (2025-04-16)
37 | ~~~~~~~~~~~~~~~~~
38 |
39 | - Added a new way of configuring the ``ProseEditorField`` by using the
40 | ``extensions`` argument. This allows specifying Tiptap extensions to use and
41 | also optionally allows configuring them. nh3 sanitization rules are
42 | automatically derived from the extension configuration when using
43 | sanitization. A system check warning is emitted if you're using this
44 | mechanism but haven't opted into sanitization.
45 | - Using the ``ProseEditorField`` without the ``extensions`` parameter has been
46 | deprecated, and a system check warning has been added for automatically
47 | detecting this.
48 | - Added support for specifying editor extensions using the
49 | ``DJANGO_PROSE_EDITOR_EXTENSIONS`` setting, which allows transparently adding
50 | JavaScript modules to the editor without having to write your own preset.
51 | Writing presets is and will be supported for even more advanced use cases,
52 | but the extensions mechanism hopefully covers 99% of all use cases.
53 | - Switched the JavaScript to use ES modules and importmaps. If you've been
54 | using 0.10 you have to update your code to use ES modules (``
48 |