Welcome! » Log In » Create A New Profile

char attribute

Posted by Yzmir Ramirez 
char attribute
April 06, 2011 08:39PM

Is the char attribute supported? Or more importantly can it?

The spec shows this as a viable character: http://www.w3.org/TR/html4/struct/tables.html#adef-char and http://www.w3.org/TR/html4/index/attributes.html

Seems Firefox doesn't much like it...I get a "XML Parsing Error: junk after document element"

Used defaults and its strips the attribute. Just wanted to know if its worth trying to support.

<table char="x">
    <colgroup char="x">
        <col char="x" />
    </colgroup>
    <tfoot char="x">
        <tr>
            <td>footer</td>
        </tr>
    </tfoot>
    <thead char="x">
        <tr>
            <th>header</th>
        </tr>
    </thead>
    <tbody char="x">
        <tr char="x">
            <td char="x">xx char set xx</td>
        </tr>
    </tbody>
</table>
Re: char attribute
April 07, 2011 05:51AM

When I first implemented this code several years ago, no browsers implemented the char attribute, so I chose not to support in HTML Purifier. Has this changed?

Re: char attribute
April 07, 2011 03:08PM

Understood, just kinda silly that the "char=" attribute is still in the spec, yet not supported by the browsers. Is "char=" a reserved keyword or something because I get XML errors.

Not an issue, I just happened to notice that while doing an audit.

Thanks.

Re: char attribute
April 07, 2011 03:13PM

Not that I know of? What was the error?

Re: char attribute
April 07, 2011 03:34PM

"XML Parsing Error: junk after document element" when you get an XML syntax error. Can anyone confirm?

I'm working on supporting deprecated tags/attributes and that came up. I'll remove support for it.

Re: char attribute
April 07, 2011 03:36PM

Hmm, that kind of sounds like a different kind of error. Do you have the full XML?

Re: char attribute
April 07, 2011 03:51PM

Actually I don't think its an issue because the DocType I used was XHTML 1.0 Strict, which of course would complain trying to use the "char=" attribute. attrbiute? Right?

Here was what I was testing with: http://bit.ly/gZwsxe

I also played around with the HTML.Allowed values like this:

table[char]
colgroup[char]
col[char]
thead[char]
tr[char]
td[char]
tfoot[char]

and kept getting XTML errors like (table summary, and td "abbr" errors). This doesn't seem to have anything to do with HtmlPurifier just browser (Firefox 3.6.16).

Re: char attribute
April 07, 2011 04:03PM

Ah, It looks like the error messages PHP are emitting aren't playing nicely with the XML.

Re: char attribute
April 07, 2011 04:11PM

D'oh...I should had viewed source and realized that. My bad.

Re: char attribute
April 07, 2011 05:06PM

According to the spec http://www.w3.org/TR/html4/sgml/dtd.html#cellhalign

it's still there too...I'll play around with it and let you know if its supported.

Author:
Your Email:

Subject:

HTML input is enabled. Make sure you escape all HTML and angled brackets with &lt; and &gt;.

Auto-paragraphing is enabled. Double newlines will be converted to paragraphs; for single newlines, use the pre tag.

Allowed tags: a, abbr, acronym, b, blockquote, caption, cite, code, dd, del, dfn, div, dl, dt, em, i, ins, kbd, li, ol, p, pre, s, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, var.

For inputting literal code such as HTML and PHP for display, use CDATA tags to auto-escape your angled brackets, and pre to preserve newlines:

<pre><![CDATA[
Place code here
]]></pre>

Power users, you can hide this notice with:

.htmlpurifier-help {display:none;}

Message: