Remove HTML tags from WYSIWYG output

Post

Posted
Rating:
#3519 (In Topic #664)
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’
I have a CPF that allows the use of Comcode, of which I'm trying to relay the contents of this field onto a comcode page.

The problem is, [html][/html] tags surround the input after using the WYSIWYG editor (assuming functions were used such as bold or underline). So when a member uses this editor to add info to this field, the HTML tags are rendered as text when relayed onto the comcode page.

I imagine I could just remove these tags from the output, but this would probably be a global change and interfere with output in other areas of the site where a member uses the WYSIWYG editor.

Is there a workaround?

The only other option I have is to drop comcode support for the CPF, but this will require the user to know basic HTML in order to use bold or linebreak tags.
Online now: No Back to the top

Post

Posted
Rating:
#3521
Avatar
Site director
Chris Graham is in the usergroup ‘Administrators’
I guess you're using the $CPF_VALUE symbol. I think you may be using * on it, which will escape it, making HTML display as code. Wrapping inside $COMCODE instead would parse Comcode in it. If in doubt please show your Tempcode here inside a code tag.


Become a fan of Composr on Facebook or add me as a friend. Add me on on Mastodon. Follow me on Minds (where I am most active). Support me on Patreon

Was I helpful?
  • If not, please let us know how we can do better (please try and propose any bigger ideas in such a way that they are fundable and scalable).
  • If so, please let others know about Composr whenever you see the opportunity or support me on Patreon.
  • If my reply is too Vulcan or expressed too much in business-strategy terms, and not particularly personal, I apologise. As a company & project maintainer, time is very limited to me, so usually when I write a reply I try and make it generic advice to all readers. I'm also naturally a joined-up thinker, so I always express my thoughts in combined business and technical terms. I recognise not everyone likes that, don't let my Vulcan-thinking stop you enjoying Composr on fun personal projects.
  • If my response can inspire a community tutorial, that's a great way of giving back to the project as a user.
Online now: No Back to the top

Post

Posted
Rating:
#3524
Joe
Avatar
Standard member
Joe is in the usergroup ‘Honoured member’

Chris Graham said

I guess you're using the $CPF_VALUE symbol. I think you may be using * on it, which will escape it, making HTML display as code. Wrapping inside $COMCODE instead would parse Comcode in it. If in doubt please show your Tempcode here inside a code tag.

1. I guess you're using the $CPF_VALUE symbol – That's correct.
2. I think you may be using * on it – Negative.
3. Wrapping inside $COMCODE instead – this worked! Thanks Chris! :)
Online now: No Back to the top
1 guest and 0 members have just viewed this.

Statistics

Forum statistics:
  • 2,052 topics, 7,195 posts, 10,830 members
  • Our newest member is Customcollective
Back to Top