RTE Text Component - plaintext | Community
Skip to main content
James_R_Green
New Participant
November 28, 2018
Solved

RTE Text Component - plaintext

  • November 28, 2018
  • 1 reply
  • 2001 views

Hi,

Is there a way to make an text/RTE component store plain text as opposed to HTML?

I realise that this is a strange question given it would make the rich text features such as bold and italic completely useless!

I want the author experience of the RTE editor and want to be able to add custom plugins but the result should be plaintext.

Alternatively is there an example of a customizable text editor in a dialog that allows for plugins/custom functionality that can store in plain text?

Thanks,

Jim

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by arunpatidar

Not sure why you want to add plain text using Rich Text Editor.

If you want to add plain text you can go for Textarea — Granite UI 1.0 documentation

Or in RTE without p tag then you can add removeSingleParagraphContainer :true It will only remove first p tag.

Or If you need to show RTE HTML tag instead of rendered RTE then don't use @ context='html' in HTL.

You can also try to create hidden field. where you can read RTE from RichText as plain text using jQuery and as plain text in hidden field.

1 reply

arunpatidar
arunpatidarAccepted solution
New Participant
November 28, 2018

Not sure why you want to add plain text using Rich Text Editor.

If you want to add plain text you can go for Textarea — Granite UI 1.0 documentation

Or in RTE without p tag then you can add removeSingleParagraphContainer :true It will only remove first p tag.

Or If you need to show RTE HTML tag instead of rendered RTE then don't use @ context='html' in HTL.

You can also try to create hidden field. where you can read RTE from RichText as plain text using jQuery and as plain text in hidden field.

Arun Patidar