magefan / module-wysiwyg-advanced

Extend TinyMCE 4 & 5 tools in Magento 2
https://magefan.com/magento2-extensions
71 stars 18 forks source link

Allow script, style, iframe etc tags. #2

Closed LiamKarlMitchell closed 5 years ago

LiamKarlMitchell commented 5 years ago

Adding this appeared to help, was trying to edit a block content, every time I switched between editor and source editing it would remove/modify the script/style tags. Also got annoyed with all the p tags everywhere maybe that will help someone else.

    $settings['extended_valid_elements'] = 'style[type] head,script[src|async|defer|type|charset],a[class|name|href|target|title|onclick|rel],iframe[src|style|width|height|scrolling|marginwidth|marginheight|frameborder],img[class|src|border=0|alt|title|hspace|vspace|width|height|align|onmouseover|onmouseout|name]';
    $settings['force_p_newlines'] = false;
    $settings['mode'] = 'textareas';
magefan commented 5 years ago

@LiamKarlMitchell , note that when you add extended_valid_elements then widget functionality is breaking.

magefan commented 5 years ago

@LiamKarlMitchell , in v2.0.5.2 we have added $settings['force_p_newlines'] = false; and $settings['valid_children'] = '+body[style]'; to enable style tag

jledfordtbc commented 3 years ago

How do we apply adjustments like the above? When the module is composer loaded I can't directly edit the module files.