Allowed HTML Tags (will have to be revised, no longer works)

knightmb

100 kW
Joined
May 7, 2006
Messages
1,071
Location
Franklin, TN
Here is a list of the currently allowed HTML tags for those that like to get fancy in their posting.
Code:
<B>
<I>
<U>
<PRE>
<EMBED>
<A>
<IMG>
<FONT>
<UL>
<OL>
<LI>
<P>
<BR>
<TABLE>
<TR>
<TD>
<BLOCKQUOTE>
<SUP>
<SUB>
 
Knight, the tag attributes don't work, they get stripped. Is their an option to stop the filter from stripping the attributes?

For instance,
Code:
[img src="xyz.jpg" align=left]
gives 
[img src="xyz.jpg"]
because the align attribute gets stripped.

I'm having to use [] instead of <> because the filter's stripping attributes even inside of code and pre tags!

The attribute is a statement at the end of a tag modifying but not fundamentally changing the tag's function. There's probably more attributes than there are tags, and the same attributes function in many tags. So for instance the 'align' attribute also can modify the p tag (paragraph -- another good one to add), such as
Code:
[p align="center"]This text will be centered[/p]
[p align="justify"]This text will be right and left justified in most browsers[/p]
Again, I'm using [ ] instead of < >.

Attributes won't present any danger I'm aware of as they'll only function within the tags you allow, because they can only modify those allowed tags.

BTW, 'ALIGN' is not an HTML tag, just an attribute (unless something's changed in recent years). But P (paragraph) and BR (line break) are other tags we could use!

Thanks!
 
Yeah, you are right. I was about run out the door and didn't think about that. Was trying to get it in before I left so others could use it. I'll have to experiment with it. The forum is very strict on how to allow HTML, which I guess is to help an accident to where you enable something and then someone puts a refer tag in the html that directs everyone to a porn site or something, LOL.

I added the "P" tag to the list, should be able to mess around with the text now. Also tried an experiment with a picture, the align seemed to make it through just fine?
 
Code:
<p align="center">This text will be centered</p>
<p align="right">This text will be right aligned in most browsers</p>

<p align="center">This text will be centered</p>
<p align="right">This text will be right aligned in most browsers</p>
 
Imagine with Align Right
Code:
<img src="http://endless-sphere.com/forums/files/e_bike_01_462.jpg" align="right">
<img src="http://endless-sphere.com/forums/files/e_bike_01_462.jpg" align="right">
 
If you place the image tag before the text, you can align the image to it. I just noticed that the filter seems OK with attributes so long as the right side is enclosed by quotes like the quotes around "right" below, it doesn't normally have to be.
Kusuma_bike_large.jpg" align="right"> This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. <br><br>This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.
 
xyster said:
If you place the image tag before the text, you can align the image to it. I just noticed that the filter seems OK with attributes so long as the right side is enclosed by quotes like the quotes around "right" below, it doesn't normally have to be.


<img src="http://upload.wikimedia.org/wikipedia/en/f/f1/Kusuma_bike_large.jpg" align="right"> This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. <br><br>This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.[/quote]

Ah, we need the BR tag too for line returns, I'll add that too.
 
Now if you enclose the whole thing in a [p align="justify"] tag, you can justify the text while keeping it aligned to the image on the right. Some browsers will not show the text justified because they don't recognize the 'justify' command.
<p align="center"><font size="7" face="Serif"><i><b>A Great Bike!</b></i></font></p>
<p align="justify"><font size="3" face="Sans-Serif" color="blue"><img src="http://upload.wikimedia.org/wikipedia/en/f/f1/Kusuma_bike_large.jpg" align="right"> This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. <br><br>This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.</font></p>
 
For some reason the "face" attribute of the "font" tag doesn't seem to be working. But it's not getting stripped either. I'm assuming the forum software overrides this and enforces it's own font type (i.e. serif, sans-serif, Times, Helvetica, etc)?
 
<p>
<font size="4" face="Verdana">
This is a Verdana font paragraph.
</font>
</p>
<p>
<font size="4" face="Times">
This is Times font paragraph.
</font>
</p>
<p>
<font size="4" face="Wingdings">
This is Wingdings font paragraph.
</font>
</p>

Yeah, they look the same, might be a CSS overriding the font type.
 
Now click the image of the bike and through the use of the "a" tag (anchor) with the "target" attribute, it'll pop open in a new window or tab for you. Unlike with javascript popups and popunders, there's no way to make harmful recurrent popups using this technique -- you know, the one's you can never close without spawning another window.
<p align="center">
<font size="7" color="red"><b><i>Great Bike!</b></i></font></p>

<p align="justify"><font size="3" face="Sans-Serif" color="blue"><a href="http://upload.wikimedia.org/wikipedia/en/f/f1/Kusuma_bike_large.jpg" target="_blank"><img src="http://upload.wikimedia.org/wikipedia/en/f/f1/Kusuma_bike_large.jpg" align="right"> </a>
This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. <br><br>This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle. This a bicycle, a very nice bicycle.</font></p>
 
Found out why the font doesn't work exactly like we want it to.
The <font> tag is deprecated in the latest versions of HTML (HTML 4 and XHTML).

The World Wide Web Consortium (W3C) has removed the <font> tag from its recommendations. In future versions of HTML, style sheets (CSS) will be used to define the layout and display properties of HTML elements.
 
Hmmm...besides the "face" attribute at least it still works, and will probably work with browsers for some years. Style sheets are very nice and precise more like professional print layout, and I'm quite familiar with them too, but they're more difficult to master and implement commands quickly in a forum setting like this.
 
xyster said:
Hmmm...besides the "face" attribute at least it still works, and will probably work with browsers for some years. Style sheets are very nice and precise more like professional print layout, and I'm quite familiar with them too, but they're more difficult to master and implement commands quickly in a forum setting like this.
I think technically I could enable the tags to produce the elements and then you could customize a font but it's a lot of work just to change it around, like you said in a forum setting.
 
I wouldn't worry about doing that.<br><font size="+1"> <u>It's just very nice to have basic html layout commands back!</u></font>
 
I think we have enough font control as is...


Here's an interesting "feature":

the images don't load in my thread view, but when I opened the compose form with topic review, the images loaded.


:?
 
Yep, just checked it...


Even if you have HTML disabled in your preferences, when you compose a reply, the html gets processed in the "topic review" panel below the reply textarea.

Strange quirk, might not be a risk since we filter most the nasty tags out.


8)
 
Yeah I had html stuff disabled by default in my prefs, setting them back on before posting a post where I wanted them to be on didn't work, it only worked in preview. Turns out you gotta set html to on by default in your profile for html tags to work.
 
Can we also have the tags

TABLE
TR
TD

?
 
Thanks, Good Sir Knightmb. Can we have
BLOCKQUOTE
too, please?
 
xyster said:
Thanks, Good Sir Knightmb. Can we have
BLOCKQUOTE
too, please?

I don't see any harm in it :)

<BLOCKQUOTE>Certainly! Certainly! Certainly! Certainly!
Certainly! Certainly! Certainly !Certainly!
Certainly! Certainly! Certainly! Certainly!
Certainly! Certainly! Certainly! Certainly!</BLOCKQUOTE>
 
Can we also have

SUP
SUB

please?
 
Thank <sub>you</sub>. That's great<sup>^2</sup>!
 
Back
Top