0
0
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:
Matt Westcott 2017-08-03 22:57:37 +01:00
parent c1b9204615
commit 9942822fca
3 changed files with 5 additions and 5 deletions

View File

@ -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

View File

@ -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')
]

View File

@ -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')