Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract_strings treats custom Draftail inline styles as blocks #778

Open
tognee opened this issue Feb 19, 2024 · 1 comment
Open

extract_strings treats custom Draftail inline styles as blocks #778

tognee opened this issue Feb 19, 2024 · 1 comment

Comments

@tognee
Copy link

tognee commented Feb 19, 2024

Currently the list of inline tags is hardcoded:
https://github.com/wagtail/wagtail-localize/blob/main/wagtail_localize/strings.py#L9

This won't work when adding InlineStyleFeature using the register_rich_text_features wagtail hook.
Adding for example a generic inline style with a span will break it up as different string as if it was a block tag.

The best solution would be to retrieve the features from the richtext instance and follow all the InlineStyleFeature tags and attributes defined.

@zerolab
Copy link
Collaborator

zerolab commented Feb 19, 2024

@tognee it makes sense. I would make it so we the list is additive. That is, we start with our set list, and add anything in InlineStyleFeature

If you have the time, please do submit a PR. Will happily review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants