Loading
Feature degradation | Gmail Email delivery failureRead More
Extend Salesforce with Clicks, Not Code
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Editing Rich Text Area Fields in Records

          Editing Rich Text Area Fields in Records

          Use rich text area fields to improve the appearance of text, including adding images and hyperlinks.

          Required Editions

          Available in: the Salesforce mobile app, Salesforce Classic, and Lightning Experience
          Available in: Essentials, Contact Manager, Group, Professional, Enterprise, Performance, Unlimited, and Developer Editions
          User Permissions Needed
          To create or change custom fields: Customize Application

          Rich text area fields use the rich text editor to format content. The rich text editors for custom fields in Lightning Experience and the Salesforce mobile app have a few differences compared to rich text editors in Salesforce Classic.

          In Lightning Experience and the Salesforce mobile app, rich text editors for custom fields use the open-source Quill library. In Salesforce Classic, rich text editors for custom fields use CKEditor. In Lightning Experience, Salesforce Knowledge and emails also use the CKEditor.

          Rich Text Editor Toolbar Button for Custom Fields In Lightning Experience and the Salesforce mobile app In Salesforce Classic
          Color Checkmark denoting support  
          Format Font (Bold, Italic, Underline, Strikethrough) Checkmark denoting support Checkmark denoting support
          Format Body (Bulleted List, Numbered List, Indent, and Outdent) Checkmark denoting support Checkmark denoting support
          Align Text (Left Align, Center Align, and Right Align) Checkmark denoting support Checkmark denoting support
          Insert Link Checkmark denoting support Checkmark denoting support
          Insert Image Checkmark denoting support Checkmark denoting support
          Remove Formatting Checkmark denoting support  
          Undo and Redo Last Action   Checkmark denoting support
          Note
          Note We recommend using the toolbar to format your content. The rich text editor provides only a WYSIWYG interface. You can’t edit HTML tags. When you copy content from a web page or another source and paste it into the editor, unsupported tags are removed. Text enclosed in unsupported tags is preserved as plain text. HTML markup counts against the character limit of the field. For more information, see Rich Text Area Field Considerations.

          Note these differences across rich text editors in Lightning Experience and the Salesforce mobile app compared to Salesforce Classic.

          In Lightning Experience and the Salesforce mobile app:

          • Spaces are considered non-empty values.
          • The default font family is the native sans-serif font on your system or device.
          • The Insert Link button enables you to enter a URL with the _blank target value by default. This button appears disabled when the record edit page is loaded, and is enabled after you activate the editor with your keyboard or mouse.
          • The Insert Image button enables you to insert an image. You can upload an image using the system file picker only. The image upload can vary across rich text editors in different feature areas. For example, in the Chatter publisher on a record page, you can also select an image that has been previously uploaded to your org.
          • The Left Align button inserts a <p> element around the content.
          • Use keyboard shortcuts to undo and redo content formatting. In Windows, undo your last action by pressing Ctrl+Z, and reverse your last undo by pressing Ctrl+Y. On Mac OS, use Cmd+Z and Cmd+Y. Alternatively, use the Edit menu in your browser to undo or redo your changes.

          In Salesforce Classic:

          • Spaces are considered empty values.
          • The default font family is Arial, Verdana, Trebuchet MS, sans-serif.
          • Color formatting is preserved when you switch to Salesforce Classic to edit a custom field that’s been formatted in Lightning Experience or the Salesforce mobile app. This occurs even though the Color button isn’t available in Salesforce Classic.
          • The Insert Link button lets you enter a URL with a selection of protocols and target values. When you switch to Lightning Experience or the Salesforce mobile app and edit the custom field, unsupported protocols or target values aren’t preserved.
          • The Insert Image button lets you insert an image by uploading it or reference one that’s hosted on another server.
          • The Left Align button initially inserts a <p> element around the content. If you remove the left alignment formatting and reuse the Left Align button on existing text that was previously left-aligned, extra <div> tags are added.

          Implementation Tips

          • Specify the size of the editor box for a rich text field by configuring the Number of lines displayed property in the field’s setup.
          • When you view or print content, Salesforce preserves the formatted version of the rich text.
          • Searches of content that contains rich text area fields ignore images and tags.
          • Deleting a rich text area field moves it to the Deleted Fields section on the custom object or Salesforce Knowledge article types.
          • You can convert rich text area fields into long text area fields only. Any images get deleted the next time you save the long text area field. After converting, markup is hidden in the long text area field but it isn’t removed from the record, so if you change your mind, you can restore the markup before you save the record.
          • The text part of a rich text area field counts toward data storage for the object that contains the field.

          Pasting Content from External Sources

          • You can copy and paste text from external sources, such as Microsoft® Word, but sometimes doing so requires reapplying the formatting.
          • Text from external sources can include HTML tags and special formatting that you can’t see and don’t need. The tags are counted against the character limit of a field. We recommend pasting text into a plain text editor such as Notepad on Windows or TextEdit on macOS first. Copy the text from the plain text editor, paste it into a rich text field, and apply formatting using the rich text field’s buttons.
          • JavaScript and CSS are treated as text. For example, if you’re creating an Idea through the API, the JavaScript or CSS code is removed without warning. Salesforce supports a limited number of approved HTML tags.
          • When a rich text area field is used in a formula, the HTML tags are stripped out before the formula is run.
          • Rich text area fields can be filtered and summarized in reports, but HTML tags and special formatting aren’t included in report results. For example, <b>some</b> <i>text</i> becomes “some text” instead of <b>some</b> <i>text</i> or some text.
          • You can use a rich text area field in a mail merge, but the HTML tags are included as text in the resulting document. Images aren’t merged.

          Images in Rich Text Area Fields

          • The maximum size of an image that can be uploaded in a rich text area field is 1 MB. You can upload only .gif, .jpg, and .png file types.
          • To upload many images, use API version 20 or later.
            Note
            Note When you upload images via the API, the alt attribute isn’t populated unless you specified it separately.
          • Images uploaded into a rich text area field are extracted in your org’s weekly export and included in the exported data.
          • Images in rich text area fields count toward file storage for the object that contains the field.
          • You can’t add a hyperlink to an image.
          • You can’t upload an image to a rich text area using the file:// protocol in the URL field. Instead, use http:, https:, data:, //, /, or a relative URL.
          • You can’t resize images in Lightning Experience and the Salesforce mobile app. An exception to this is in Lightning Knowledge when using the Chrome browser.

          Formatting Support

          The power of the rich text editor is in its WYSIWYG interface. Type in the editor and use the toolbar to format your content as much as you can. When you paste formatted content from another source, you can expect some formatting differences in Lightning Experience and the Salesforce mobile app. Here are formatting considerations to look out for.

          Warning
          Warning If you add a custom rich text area field in Salesforce Classic and edit it in Lightning Experience, you can also expect the formatting differences. Saving your changes in Lightning Experience overwrites the original formatting you had in Salesforce Classic and conversely. Alternatively, you can fix some of the formatting using the toolbar or switch to Salesforce Classic to perform your edits.
          Colors
          The Color button is available in Lightning Experience only. Color formatting is preserved when you edit the rich text field in Salesforce Classic. The rich text field in Lightning Experience handles color formatting in RGB format, which adds the <span style="color: rgb(255, 0, 0);"></span> tag around your text. The rich text field in Salesforce Classic handles color formatting in hexadecimal format, which adds the <span style="color: #ff0000;"></span> tag around your text. The RGB and hexadecimal value depends on the color you choose.
          Definition lists

          Formatting for definition lists is preserved, but the styling appears different in Lightning Experience and the Salesforce mobile app. Definition terms are not bold.

          Fonts

          Pasting text with a predefined font face, color, or size converts the font tag into a span tag with the style attribute.

          Headings
          Heading styles are different in Lightning Experience and Salesforce Classic. Headings in Salesforce Classic are bold and become smaller in size as the header level increases in number. Headings in Lightning Experience have the following font size and weight.
          • h1: 24 px (not bold)
          • h2: 18 px (bold)
          • h3: 18 px (not bold)
          • h4: 14 px (bold)
          • h5: 14 px (not bold)
          • h6: 12 px (bold)
          Inline styles on h1, h2, h3, h4, h5, and h6 tags are not supported and are ignored.
          Hyperlinks
          Hyperlinks always open in a new window or tab in Lightning Experience and the Salesforce mobile app using target=”_blank”. In Salesforce Classic, you can use different target values in hyperlinks in the rich text field. If you edit a rich text field with such a link in Lightning Experience or the app, the target value is converted to _blank.
          Inline styles
          In Salesforce Classic, inline styles are supported on div, span, p, br, and hr tags. In Lightning Experience and the Salesforce mobile app, inline styles are supported only on span tags.
          Lists
          Nested ordered lists in rich text fields are numbered differently in Salesforce Classic than they are in Lightning Experience and the Salesforce mobile app. In Salesforce Classic, nested ordered lists are numbered with this pattern: 1, 1, 1. In Lightning Experience and the Salesforce mobile app, nested ordered lists are numbered with this pattern: 1, a, i.
          In Lightning Experience and the Salesforce mobile app, you can’t nest a bulleted list within a numbered list. The nested bulleted list is converted to a numbered list when you paste it into the editor.
          You also can’t nest a numbered list within a bulleted list. The nested numbered list is converted to a bulleted list when you paste it into the editor.
          Warning
          Warning Nesting lists of different types is supported in Salesforce Classic only. Don’t edit an existing rich text area field containing a nested list of a different type in Lightning Experience and the Salesforce mobile app. If you do, the nested list is converted to the same type as its parent list, even if you don’t edit the list itself.

          Nested lists of the same type are supported. However, pasting a nested list into the editor flattens the list into one list in Lightning Experience and the Salesforce mobile app. For example, a nested bulleted list within a bulleted list becomes a single bulleted list when pasted. For nested lists of the same type, use the toolbar to adjust your list formatting. You can also press the Tab key or Shift+Tab to create a nested list item or remove a nested list item.

          Note
          Note In Lightning Experience and the Salesforce mobile app, pasting lists that are copied from Microsoft® Word is not supported and results in list items getting converted into paragraphs. Although they look visually like lists, they are pasted as p tags.
          Paragraphs and line breaks
          Pressing the Enter key creates a paragraph in Lightning Experience and the Salesforce mobile app. However, pressing the Enter key in Salesforce Classic adds a <br> element inside the current paragraph. The visual difference is minor.
          Markup for blank lines is <p><br></p> in Lightning Experience and the Salesforce mobile app, and <br> in Salesforce Classic. If you create text in a rich text field in Lightning Experience or the Salesforce mobile app and later edit it in Salesforce Classic, markup for the blank lines is converted to <p>&nbsp;</p>. Subsequent edits in Lightning Experience or the Salesforce mobile app don’t change blank lines back to their original markup.
          Paragraphs in rich text editors add extra characters to the text when saved in Lightning Experience and the Salesforce mobile app. Each paragraph contributes seven characters <p> </p> to the character count. For example, if your admin specifies a 5000 character limit, you can enter only 4993 characters in the rich text editor of a custom field in Lightning Experience. Breaking the text into multiple paragraphs further reduces the number of characters you can enter. Blank lines contribute no visible characters, but contribute several characters with their markup.
          Note
          Note RichText field values are returned in HTML format. That means it might contain block elements. Nesting block elements as merge fields in inline elements can cause formatting issues in HTML. If you're using the RichText custom field as a merge field, consider applying HTML customizations, like fonts, to the custom field itself. If you want only text data in the custom field, use TextField instead.
          Special Characters
          Since rich text field values are returned in HTML format, some characters are escaped when the custom field value is retrieved through the API.
          • Ampersand character & is returned as &amp;
          • Greater than character > is returned as &gt;
          • Less than character < is returned as &lt;
          • Quote character " is returned as &quot;
          • Single quote character ' is returned as &#39;
          • Some special characters, such as emoji, are rendered in inconsistent formats. The return value depends on your platform and the receiving end of the API response.
          Tables
          In Salesforce Classic, Lightning Experience, and the Salesforce mobile app, pasting tables is supported, but you can edit only the content within the tables.
          Text-level markup
          • Addresses with address tags cause enclosing list formatting to be removed.
          • Nested quotes using q tags are not supported.
          • Strikethrough text uses strike tags.
          • Teletype text within tt tags is converted to use code tags.

          This table lists supported HTML tags and formatting considerations in Lightning Experience and the Salesforce mobile app. When you edit a rich text field or paste text with unsupported tags in Lightning Experience and the Salesforce mobile app, those tags are removed. Text that was enclosed in unsupported tags is preserved as plain text.

          HTML Tags Supported in Salesforce Classic Supported in Custom Fields in Lightning Experience and the Salesforce Mobile App? Comments for Lightning Experience and the Salesforce Mobile App
          a Checkmark denoting support The target attribute is always set to _blank. This tag is removed if href has no value.
          abbr Checkmark denoting support  
          acronym   This tag is converted into an abbr tag.
          address Checkmark denoting support When text with this tag is nested in a list and pasted in the editor, the list tags,ol, li, and ul, are removed. Some tags before the address tag get nested in address.
          b Checkmark denoting support  
          bdo Checkmark denoting support  
          big Checkmark denoting support  
          blockquote Checkmark denoting support Consecutive block quotes are merged.
          br Checkmark denoting support Line breaks are nested in p tags.
          caption Checkmark denoting support  
          cite Checkmark denoting support  
          code Checkmark denoting support  
          col Checkmark denoting support  
          colgroup Checkmark denoting support  
          dd Checkmark denoting support  
          del Checkmark denoting support  
          dfn Checkmark denoting support  
          div Checkmark denoting support  
          dl Checkmark denoting support  
          dt Checkmark denoting support Definition terms are not bold.
          em Checkmark denoting support  
          font   Pasting text with a predefined font face, color, or size converts the font tag into a span tag with the style attribute.
          h1 Checkmark denoting support Inline styles on headings are not supported.
          h2 Checkmark denoting support Inline styles on headings are not supported.
          h3 Checkmark denoting support Inline styles on headings are not supported.
          h4 Checkmark denoting support Inline styles on headings are not supported.
          h5 Checkmark denoting support Inline styles on headings are not supported.
          h6 Checkmark denoting support Inline styles on headings are not supported.
          hr Checkmark denoting support  
          i Checkmark denoting support  
          img Checkmark denoting support  
          ins Checkmark denoting support  
          kbd Checkmark denoting support  
          li Checkmark denoting support Pasting a nested list of the same type flattens the list into one list, for example, a nested bulleted list within a bulleted list. Use the toolbar to adjust your list formatting.
          ol Checkmark denoting support Nesting an ordered list (numbered) in an unordered list (bulleted) converts the ordered list into an unordered list.
          p Checkmark denoting support Pressing Enter creates a new p.
          pre Checkmark denoting support  
          q Checkmark denoting support Nested quotes are not supported.
          s   This tag is converted into a strike tag.
          samp Checkmark denoting support  
          small Checkmark denoting support  
          span Checkmark denoting support This tag is nested in a p tag, which adds extra padding around the text.
          strike Checkmark denoting support  
          strong Checkmark denoting support  
          sub Checkmark denoting support Nested sub tags are merged.
          sup Checkmark denoting support Nested sup tags are merged.
          table Checkmark denoting support  
          tbody Checkmark denoting support  
          td Checkmark denoting support  
          tfoot Checkmark denoting support  
          th Checkmark denoting support  
          thead Checkmark denoting support  
          tr Checkmark denoting support  
          tt   This tag is converted into a code tag.
          u Checkmark denoting support  
          ul Checkmark denoting support Nesting an unordered list (bulleted) in an ordered list (numbered) converts the unordered list into an ordered list.
          var Checkmark denoting support  
           
          Loading
          Salesforce Help | Article