[TYPO3-english] Typo3 strange html "repair"
Christopher Torgalson
bedlamhotel at gmail.com
Thu Oct 29 23:08:17 CET 2009
Hi,
On Thu, Oct 29, 2009 at 2:38 PM, Pero Matic <pero at matic.com> wrote:
> Pero Matic wrote:
>> Hi. I made some changes to one extension which returns piece of html.
>> In that piece of html there is also this:
>>
>> <option value="1" selected="">Something</option>
>>
>> The problem is that my original $content value prior to return from
>> extension class looks like:
>>
>> <option value="1" selected>Something</option>
>>
>> I made echo $content; prior to return from class so I know this for
>> sure.
>> Now, does anybody knows where this ="" (in front of selected) came
>> from ??? Thx!
>
> It seem i found it.
>
> config.xhtml_cleaning = all
>
> is causing this.
Provided the doctype of the page is some variant of xhtml, you will
see the same in e.g. Mozilla-based browsers because <option value="1"
selected> is invalid html. The correct form is <option value="1"
selected="selected">. It looks slightly nonsensical, but in xhtml,
attributes must be quoted, and may NOT be minimized [1]. The best fix
is to alter your extension's output so that it produces valid (x)html.
[1] http://www.w3.org/TR/xhtml1/#h-4.5
--
Christopher Torgalson
http://www.typo3apprentice.com/
More information about the TYPO3-english
mailing list