1741 views

How to disable the Paste Formatting option with the TinyMCE HTML Editor

 

Overview


With the Jakarta release, there have been few improvements done with the TinyMCE editor and new features have been implemented as per following document:

https://docs.servicenow.com/bundle/jakarta-release-notes/page/release-notes/servicenow-platform/ui-rn.html#ui-release-notes__ul_qc1_fdt_s5

One of the features introduced was Paste Formatting Options as per the following document:

https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/use/using-forms/task/paste-html-editor.html

Due to this new feature, when users paste content into any html field, they see a popup with a message asking whether to keep or remove the formatting in the pasted content.

For users who are dealing with a high number of copy and paste into html field as part of daily job, this new functionality might be annoying. This article details how to disable this new feature with TinyMCE editor.

 

 

Solution


Import the attached sys_ui_macro_546aeeafdbcbc70081e390b6db961908.xml on your instance.  

Please refer to the document below for instructions on how to import an xml file into an instance:

https://docs.servicenow.com/bundle/jakarta-servicenow-platform/page/administer/development-best-practices/task/t_ImportARecordAsXMLData.html

 

Importing this record will add a UI macro named tinymce_setup to your instance. Make this UI macro active. Once the UI Macro is activated, it provides the ability to override the default tinymce_setup.xml.

The following properties are added in the attached UI Macro, so that the Paste Formatting option is disabled, and the content will always be pasted without any formatting. If there were any formatting, they will be cleaned.

powerpaste_word_import: 'clean', 
powerpaste_html_import: 'clean', 

 

Ref. additional TinyMCE properties:

https://www.tinymce.com/docs/plugins/powerpaste/ 

 

Ref. enhancement request discussion on SN Community:
https://community.servicenow.com/message/1250203#1250203

Article Information

Last Updated:2018-06-11 14:24:59
Published:2018-06-11