'tinymce automatic list items
I am using the tinymce lib. this is my code:
<div class="beschreibung"></div>
<script>
tinymce.init({
selector: '.beschreibung',
inline: true,
menubar: false,
skin: "oxide-dark",
toolbar: 'bold italic bullist',
plugins: ['lists','autoresize'],
toolbar_location: 'bottom',
language: 'de'
});
</script>
This works fine.
Example:
But now I would realize an automatic creation of list items. My idea:
I write "- "
(a single line with a space)
This should create a list item automatically.
Is there a tinymce solution available ?
Solution 1:[1]
The textpattern
plugin provides this functionality for TinyMCE. It will match against certain patterns while typing and perform an action, such as converting a line starting with -
into a list when pressing enter. You can add other custom patterns as well by configuring the textpattern_patterns
setting, however the default should do what you require.
See https://www.tiny.cloud/docs/plugins/opensource/textpattern/ for more information.
Solution 2:[2]
For those who want to off this functionality.
Text patterns are now on by default: text_patterns: false
turns the functionality off.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|---|
Solution 1 | newso |
Solution 2 | Qrzysio |