Skip to content

How to use RegExp in htmlSupport #55

@reinsp5

Description

@reinsp5

Hello. Thank you for the useful plugin.

I having one problem.
Trying to use regular expressions in htmlSupport but it is not working.
I'm trying to use Strapi as a CMS for my site.
The site uses an existing CSS framework and I want to write the classes provided by the CSS framework within CKEditor.

So far I have tried the following specifications, but none of them work: the class specification is removed.
How can I help...

Flow at build

  1. Edit plugin.js
  2. rm -rdf .cache ( in container )
  3. rm -rdf build ( in container )
  4. yarn cache clear --all ( in container )
  5. yarn build ( in container )
  6. docker-compose down
  7. docker-compose up -d

Try. 1

// config/plugins.js
module.exports = () => {
    return {
        ckeditor: {
            enabled: true,
            plugin: {
                generalHtmlSupport: true,
            },
            config: {
                editor: {
                    htmlSupport: {
                        allow: [{
                            name: /.*/,
                            classes: true,
                        }]
                    }
                }
            }
        }
    }
}

Try. 2

// config/plugins.js
module.exports = () => {
    return {
        ckeditor: {
            enabled: true,
            plugin: {
                generalHtmlSupport: true,
            },
            config: {
                editor: {
                    htmlSupport: {
                        allow: [{
                            name: '/.*/',
                            classes: true,
                        }]
                    }
                }
            }
        }
    }
}

Try. 3

// config/plugins.js
module.exports = () => {
    return {
        ckeditor: {
            enabled: true,
            plugin: {
                generalHtmlSupport: true,
            },
            config: {
                editor: {
                    htmlSupport: {
                        allow: [{
                            name: "/.*/",
                            classes: true,
                        }]
                    }
                }
            }
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions