function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Avanish KAvanish K 

How to upload image and code snip in lightning:formattedRichText component

The lightning:formattedRichText does not have option to put code snip and Image files. Can we upload both thing in this component or do we have any alternate?
Raj VakatiRaj Vakati
A lightning:insertImageButton component adds an image button to the toolbar of a rich text editor. The button is used to upload an image and insert it inline. The component can only be used as a child component within the lightning:inputRichText component.
Here's an example that adds the image button to the rich text editor's toolbar
 
<aura:component>
    <lightning:inputRichText value="<b>HELLO</b>">
        <lightning:insertImageButton/>
    </lightning:inputRichText>
</aura:component>