hvlads / django-ckeditor-5

Django CKEditor 5 integration.
Other
152 stars 60 forks source link

Cant configure wordCount plugin #209

Closed Mxgra closed 6 months ago

Mxgra commented 7 months ago

Hi, first of, thanks for the great django implementation of ckeditor!

I'm learning a little django on the side and just upgraded to django-ckeditor-5, but it seems that I now can't configure the wordCount plugin? Specifically I want to limit the number of chars one can write. E.g from my settings.py the CKEDITOR_5_CONFIGS:

'profiles': {
        'toolbar': ['heading', '|', 'bold', 'italic', 'link', '|' 'numberedList',
                    'bulletedList', '-', 'undo', 'redo'],
        "height": 291,
        "width": 'auto',
        "resize_minWidth": 940,
        "filebrowserWindowWidth": 940,
        "filebrowserWindowHeight": 725,
        'wordCount' : { "displayWords": "false",
                       "displayCharacters": "false",
                        'showCharCount': 'true',
                        'showWordCount': 'false',
                       'showParagraphs': 'false',
                       'maxCharCount': '5',
                       'showRemaining': 'true',
                       'countHTML': 'true',
                       'countSpacesAsChars': 'false',
                       'countLineBreaks': 'false',}  # Set the maximum word count
    },

Probably I'm doing something wrong, but maybe there's a bug somewhere? I searched around and couldn't find a solution or other people with my problem...

goapunk commented 7 months ago

@Mxgra as far as I can see the word count plugin is literally just that, it shows the amount of words / characters. It can't do anything else, e.g. limit the number of characters. According to https://github.com/ckeditor/ckeditor5/issues/2573 this feature hasn't made it into ckeditor5 yet.