#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Jan 29, 2014 10:07:14 GMT -8
I'd like to be able to post a HTML tag, specifically a <div> tag, but would like to give it a class , or even an ID would do, but both the class and id attributes are stripped out when posting or even flipping from Preview to BBCode and vice-versa.
So, is it possible and I'm just not seeing how, or would it be possible to allow class names and/or ID attributes to be posted with HTML tags?
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Feb 3, 2014 10:13:35 GMT -8
Since this is in the plugin development board, are you trying to do this programmatically?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Feb 3, 2014 12:18:17 GMT -8
Yup, it's specifically for a whisper plugin.
To make the whispers more secure I thought about posting a classed HTML tag, which could then be hidden by default, and the plugin displaying the correct ones, but, if I try to add a class to a posted tag it gets stripped out.
I also tried to give the tags an ID, but that was removed also.
|
|
inherit
The Dream Crusher (Ret.)
164921
0
Apr 1, 2014 11:00:25 GMT -8
Tim Camara
Teach a man to fish, etc., etc.
1,721
March 2011
tcamara
|
Post by Tim Camara on Feb 3, 2014 13:45:08 GMT -8
Can you show me the snippet of code you're trying to use to do this?
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Feb 3, 2014 17:41:14 GMT -8
I've been using a function written by Chris, and can successfully put the tags into the WYSIWYG editor, either as [div class="whisper"]xxxxxx[/div] in the BBCode side, and <div class="whisper">xxxxxx</div> in the Preview side, but on posting, or when moving from Preview to BBCode, and vice-versa, the class is stripped from the tag. If you can understand that.. I thought that if I could post a HTML tag with a class already assigned it could be hidden by default, and so making it more secure, even in the Mobile App.
|
|
inherit
97216
0
Nov 26, 2024 13:53:14 GMT -8
Bennett 🚀
Formerly iPokemon.
3,622
January 2007
catattack
iPokemon's Mini-Profile
|
Post by Bennett 🚀 on Feb 3, 2014 17:46:43 GMT -8
Might sound counter-intuitive, but perhaps check out the style tag plugin to see how I attach attributes to divs, or even just use the style tag as a hack.
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Feb 4, 2014 10:21:56 GMT -8
Thanks for the reply Bennett 🚀, but I'm trying to get posted tags to have a class or ID by default. Using a code to attach the className is what I am trying to avoid, so that the tags will be effected by the forum's CSS even if the plugins are disabled.
|
|
inherit
2671
0
May 14, 2013 14:40:03 GMT -8
Peter
🐺
10,615
February 2002
peter3
|
Post by Peter on Feb 4, 2014 11:06:37 GMT -8
Why not still use a supported attribute that isn't stripped out, but match the div based on what the attribute is. No JS needed, so the div would be effected by the CSS selector. i.e div[title=Whisper] {
display: none;
} [div title="Whisper"]something something[/div] www.w3.org/TR/CSS2/selector.html#attribute-selectors
|
|
#00AF33
Official Code Helper
19529
0
1
Nov 19, 2012 14:18:28 GMT -8
Todge
**
17,324
January 2004
todge
|
Post by Todge on Feb 4, 2014 13:58:44 GMT -8
HA!! I tried ID, class and style, and neither worked.. I never even thought about trying title. Thanks Peter, methinks this will do nicely.
|
|