Skip to Content Skip to Menu

keep html tags in textarea

  • Giankomat
  • Giankomat
  • OFFLINE
  • Posts: 56
  • Thanks: 0
  • Karma: -1
  • Add-ons
9 years 10 months ago - 9 years 10 months ago #256188 by Giankomat
keep html tags in textarea was created by Giankomat
All the joomla wysiwyg editors trims some html tag, fixes tag incoerences or redundaces trimming out the tags (example: <p><h1></p></h1> , joomla default editor even delete spans without attributes <span>abc</span>)
Basically with joomla it looks there is no chance to tell the editor don't touch the tags at all (even jce).

Ok, now the topic :)
I don't need editors in this case, but my CB textareas field should keeps the tag structure, no matter the DOM errors, no matter anything.
I tried a plain textarea without editor,
"Forbidden words in user profile edits" setting is empty, but the field still trims all the tags.
Is this the normal behaviour?

The method I found is use "Editor Text Area" field, but disable the editor in joomla general config, but that's cannot be a solution..
Last edit: 9 years 10 months ago by Giankomat.

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

  • heyai
  • heyai
  • OFFLINE
  • Posts: 324
  • Thanks: 79
  • Karma: 24
9 years 10 months ago #256195 by heyai
Replied by heyai on topic keep html tags in textarea
Do you absolutely have to use html tags? These editors and maybe joomla itself strip them for a reason. I don't know how to avoid this and wouldn't try to.

You might be able to use nonumber's sourcerer for this: www.nonumber.nl/extensions/sourcerer
But please consider using alternatives, as this might break your site and make you vulnerable to hacking.

hey-ai - the community for asian guys and non-asian girls

The search bar is your friend, not just decoration!

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

  • Giankomat
  • Giankomat
  • OFFLINE
  • Posts: 56
  • Thanks: 0
  • Karma: -1
  • Add-ons
9 years 10 months ago - 9 years 10 months ago #256205 by Giankomat
Replied by Giankomat on topic keep html tags in textarea

heyai wrote: Do you absolutely have to use html tags?


Yes. It's part of my design and the users won't edit those textarea, just the admins will and they know they don't have to touch the html tags.
I would avoid sourcerer, I will take it as last shot (for scripting in component/module I usually prefer Jumi).
Maybe "Authorized input" is the field I have to set properly?
I just need <dl>, <dd>,<div>,<p>,<span>,<strong>,<small>.
nothing else
Last edit: 9 years 10 months ago by Giankomat.

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48481
  • Thanks: 8283
  • Karma: 1443
9 years 10 months ago #256261 by krileon
Replied by krileon on topic keep html tags in textarea
Even if you use the view source feature for the editor the jQuery for the editor is still fired on form submit. This jQuery is what runs formatting on the editor contents. The only way to turn off the formatting is to edit your editor settings and shut it off. For JCE I'm pretty confident there is a setting to do this and recommend posting on JCE forums regarding this.

This isn't really a CB issue though and CB can't do anything about it; CB simple renders the editor through Joomla API and fires its jQuery as needed. CB does have a filtering functionality, but it's done PHP side and only removes security vulnerable tags (it does not reformat as you're experiencing). However even then you can whitelist such tags if desired.


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.

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

  • Giankomat
  • Giankomat
  • OFFLINE
  • Posts: 56
  • Thanks: 0
  • Karma: -1
  • Add-ons
9 years 9 months ago #256521 by Giankomat
Replied by Giankomat on topic keep html tags in textarea

krileon wrote: However even then you can whitelist such tags if desired.


just for testing or you think it could works? :)
not sure about the value of that field for settings those tags I post..

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

  • krileon
  • krileon
  • ONLINE
  • Posts: 48481
  • Thanks: 8283
  • Karma: 1443
9 years 9 months ago #256539 by krileon
Replied by krileon on topic keep html tags in textarea
Those tags don't need to be whitelisted. Only tags like script and iframe are removed. At any rate the parameter is within CB > Configuration > User Profile. The issue you're experiencing is an issue coming from your editor; CB can't do anything about that.


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.

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

Moderators: beatnantkrileon
Powered by Kunena Forum