mirror of
https://github.com/wagtail/wagtail.git
synced 2024-11-29 09:33:54 +01:00
Make paragraph elements an always-on plugin rather than configurable with plugins
This commit is contained in:
parent
c1b9204615
commit
9942822fca
@ -72,11 +72,10 @@ This can be achieved by passing a ``features`` keyword argument to ``RichTextFie
|
||||
|
||||
.. code-block:: python
|
||||
|
||||
body = RichTextField(features=['p', 'h2', 'h3', 'b', 'i', 'link'])
|
||||
body = RichTextField(features=['h2', 'h3', 'b', 'i', 'link'])
|
||||
|
||||
The recognised feature identifiers are as follows (note that add-on modules may add to this list):
|
||||
|
||||
* ``p`` - paragraph text (text entered into a rich text field appears in this mode by default, so omitting this from ``features`` is unlikely to be meaningful)
|
||||
* ``h1``, ``h2``, ``h3``, ``h4``, ``h5``, ``h6`` - heading elements
|
||||
* ``bold``, ``italic`` - bold / italic text
|
||||
* ``ol``, ``ul`` - ordered / unordered lists
|
||||
|
@ -75,7 +75,8 @@ CORE_HALLO_PLUGINS = [
|
||||
HalloPlugin(name='halloreundo', order=50),
|
||||
HalloPlugin(name='hallorequireparagraphs', js=[
|
||||
static('wagtailadmin/js/hallo-plugins/hallo-requireparagraphs.js'),
|
||||
])
|
||||
]),
|
||||
HalloHeadingPlugin(element='p')
|
||||
]
|
||||
|
||||
|
||||
|
@ -214,11 +214,11 @@ def register_core_features(features):
|
||||
)
|
||||
features.default_features.append('italic')
|
||||
|
||||
for element in ['p', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6']:
|
||||
for element in ['h1', 'h2', 'h3', 'h4', 'h5', 'h6']:
|
||||
features.register_editor_plugin(
|
||||
'hallo', element, HalloHeadingPlugin(element=element)
|
||||
)
|
||||
features.default_features.extend(['p', 'h2', 'h3', 'h4'])
|
||||
features.default_features.extend(['h2', 'h3', 'h4'])
|
||||
|
||||
features.register_editor_plugin(
|
||||
'hallo', 'ol', HalloListPlugin(list_type='ordered')
|
||||
|
Loading…
Reference in New Issue
Block a user