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.

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

1 Answer 1

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>
3
  • No Zack. It doesn't change anything. It's the same still
    – uma451
    Mar 5, 2019 at 16:17
  • Edited my answer Mar 5, 2019 at 16:36
  • Exactly tried the way you suggested. But no luck !!!!
    – uma451
    Mar 6, 2019 at 5:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .