Skip to Content Skip to Menu

CB Activity: is plain-text-only paste intentional, and is there a supported way

  • mjl1817
  • mjl1817
  • ONLINE
  • Posts: 55
  • Thanks: 7
  • Karma: 1
1 day 2 hours ago #344602 by mjl1817
Hi Kyle,

I run nosterest.com (Joomla 6.1.4, PHP 8.3) with CB Activity, package 7.1.0 build 2026.08.31.17.16.12 (the plugin's cbactivity.xml says version 2.11.0).

What we see
When someone copies formatted text, for example a narrative with bold, headings and lists copied from a web page or a chat tool, and pastes it into the regular activity wall message box, the formatting is lost. People have to reformat by hand after pasting. We'd like this to work for everyone who uses an activity wall.

What we found when we looked into it (we haven't changed any of your files)

The message box is a contenteditable div. The paste handler in jquery.cbactivity.js cancels the browser's default paste and inserts only the plain-text version of the clipboard.
Formatting seems to be supported only as BBCode, and the per-stream BBCode option is off by default.
We found no setting for HTML, Markdown or a rich-text editor.
Our questions

Is the plain-text-only paste intentional? If so, is there a reason we should know about, such as security, cross-browser consistency or your design direction?
Is there a supported setting, hook or event for keeping formatting on paste, or for converting pasted formatting into BBCode?
If not, we're considering a small, separate script that sits outside CB. It would listen for the paste before your handler, convert the clipboard into a short allowlist of BBCode (bold, italic, lists, links, quotes, code), and insert it as plain text. The server would still only receive ordinary text, and nothing would accept HTML. Is there anything about that approach that would conflict with how CB Activity works or with your plans, such as an editor in a future release?
We don't want to work against your design, so we'd rather ask first. Thanks for your time and for the great plugin.

Best regards,
Michael

I wish I knew, Then we would both know.

Please Log in or Create an account to join the conversation.

  • krileon
  • krileon
  • ONLINE
  • Posts: 50734
  • Thanks: 8696
  • Karma: 1475
10 hours 32 minutes ago #344603 by krileon
CB Activity only accepts plain text except for system activity, which does allow HTML. At this time copy and paste will always strip HTML. In a future release if BBCode is enabled in the stream it will attempt to convert to BBCode on paste. Went ahead and added a feature ticket for this.

forge.joomlapolis.com/issues/9951

In the future yes there are plans to replace the built in contenteditable with a BBCode/Markdown editor with limited formatting options. There are no plans to ever support raw HTML in the stream outside of system activity, which is meant to be done programmatically (e.g. generate custom activity during an event).


Kyle (Krileon)
Community Builder Team Member
Before posting on forums: Read FAQ thoroughly + Read our Documentation + Search the forums
CB links: Documentation - Localization - CB Quickstart - CB Paid Subscriptions - Add-Ons - Forge
--
If you are a Professional, Developer, or CB Paid Subscriptions subscriber and have a support issue please always post in your respective support forums for best results!
--
If I've missed your support post with a delay of 3 days or greater and are a Professional, Developer, or CBSubs subscriber please send me a private message with your thread and will reply when possible!
--
Please note I am available Monday - Friday from 8:00 AM CST to 4:00 PM CST. I am away on weekends (Saturday and Sunday) and if I've missed your post on or before a weekend after business hours please wait for the next following business day (Monday) and will get to your issue as soon as possible, thank you.
--
My role here is to provide guidance and assistance. I cannot provide custom code for each custom requirement. Please do not inquire me about custom development.
The following user(s) said Thank You: mjl1817

Please Log in or Create an account to join the conversation.

Moderators: beat, nant, krileon
Powered by Kunena Forum