django-cms / djangocms-text-ckeditor

Text Plugin for django CMS using CKEditor 4
https://www.django-cms.org/en/repositories-plugins/
BSD 3-Clause "New" or "Revised" License
164 stars 186 forks source link

[BUG] Setting `ALLOW_TOKEN_PARSERS` is not extended #647

Closed DmytroLitvinov closed 8 months ago

DmytroLitvinov commented 9 months ago

According to documentation, it says that I can provide custom token parsers via settings ALLOW_TOKEN_PARSERS

If we check source code https://github.com/django-cms/djangocms-text-ckeditor/blob/50bc9c1c8d14a7a9f3eb9a9620a39a0e25ec8923/djangocms_text_ckeditor/settings.py#L39 we can see it is hardcoded and not updated via django.conf.settings.

My proposal is to add something like next:

ALLOW_TOKEN_PARSERS = [
  'djangocms_text_ckeditor.attribute_parsers.DataAttributeParser',
  *getattr(settings, 'ALLOW_TOKEN_PARSERS', []),
]
fsbraun commented 9 months ago

@DmytroLitvinov Can I interest you in creating a PR?

DmytroLitvinov commented 9 months ago

@fsbraun , sure. Prepared MR