Skip to content

Instantly share code, notes, and snippets.

@xiaohutai
Created November 14, 2017 11:16
Show Gist options
  • Save xiaohutai/d64e3434baead4a9d52d5f064b2878b0 to your computer and use it in GitHub Desktop.
Save xiaohutai/d64e3434baead4a9d52d5f064b2878b0 to your computer and use it in GitHub Desktop.
Set custom tags in Bolt CKEditor

In app/config/config.yml:

wysiwyg:
    (...)
    ck:
        (...)
        format_tags: "p;h2;h3;h4;info;warning;error;success"
        format_info: { name: "Info", element: "p", attributes: { 'class': 'info' } }
        format_warning: { name: "Warning", element: "p", attributes: { 'class': 'warning' } }
        format_error: { name: "Error", element: "p", attributes: { 'class': 'error' } }
        format_success: { name: "Success", element: "p", attributes: { 'class': 'success' } }
@xiaohutai
Copy link
Author

xiaohutai commented Nov 14, 2017

Default value for format_tags is "p;h1;h2;h3;h4;h5;h6;pre;address;div;info;warning;error;success"
Source: https://docs-old.ckeditor.com/ckeditor_api/symbols/CKEDITOR.config.html#.format_tags

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment