0

I'm having a lightning out app. In that I'm displaying a lightning:inputRichText and a lighning:button. On clicking 'save' button, I'm displaying the value entered in that field to the inline vf page of the record detail page.

All formatting are working except the indentation. Below is my code.

Lightning out:

<lightning:inputRichText aura:id="commentBody" value="{!v.commentBody}" placeholder = "Enter your comments here" shareWithEntityId = "{!v.recordId}">
  <lightning:insertImageButton/>
</lightning:inputRichText>  

Inline VF page:

<apex:outputField value="{!comment.cmt.CommentBody__c}"/>

Below is my output:

Screenshot

I tried with apex:outputText and escape = false. That too didn't work. Any suggestion from you will be appreciated.

Thank you.

  • Does white-space: pre; style/css on the output element make any different? – Phil Hawthorn Mar 5 at 16:38
  • No Phil, the result is same – uma451 Mar 11 at 6:18
0

Try this. Displaying rich text is a little tricky but using this style has worked for us. You can also try wrapping the apex:outputText in a div and giving it the style shown below.

<style>
    .richtext p {
        margin: 0;
    }
</style>
<apex:outputText value="{!comment.cmt.CommentBody__c}" escape="false" styleClass="richtext" />

EDIT: Did you try this way?

<style>
    .richtext p {
        margin: 0;
    }
</style>
<div class="richtext">
    <apex:outputText value="{!comment.cmt.CommentBody__c}" escape="false" styleClass="richtext" />
</div>
  • No Zack. It doesn't change anything. It's the same still – uma451 Mar 5 at 16:17
  • Edited my answer – Zack Walton Mar 5 at 16:36
  • Exactly tried the way you suggested. But no luck !!!! – uma451 Mar 6 at 5:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.