Enable only a few headings in CKEditor

Allowing every format is way more than what we initially intended.

I've only added h2 and h3 because h1 is set somewhere else in the page
(like the title), and h4, h5 and h6 are usually not necessary.
This commit is contained in:
Javi Martín
2018-09-07 13:37:07 +02:00
parent b6855b7140
commit 9705360d98
2 changed files with 2 additions and 1 deletions

View File

@@ -14,6 +14,7 @@ CKEDITOR.editorConfig = function( config )
config.filebrowserUploadUrl = "/ckeditor/attachment_files";
config.allowedContent = true;
config.format_tags = "p;h2;h3";
// Rails CSRF token
config.filebrowserParams = function(){

View File

@@ -1,6 +1,6 @@
class WYSIWYGSanitizer
ALLOWED_TAGS = %w(p ul ol li strong em u s img a h1 h2 h3 h4 h6 pre addres div)
ALLOWED_TAGS = %w(p ul ol li strong em u s img a h2 h3)
ALLOWED_ATTRIBUTES = %w(href style src alt)
def sanitize(html)