﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc
3483	Editor removes all attributes of <source> element except 'lang'	RalfSchmelter		"Hi,

the editor removes all attributes of the <source> element (used for syntax highlighted code), except the 'lang' attribute. While it would be nice, if all attributes could be edited by the FCKEditor, the non-editable ones should at least not be removed when switching back to Wikitext.

You can reproduces this bei adding the following to a Wiki page:
{{{
<source lang=""java"" line=""on"" start=""1"" enclose=""pre"" strict=""on"">
Hello World!
</source>
}}}
Open it in the editor and switch to Wikitext. Every attribute is gone, except the 'lang' one.

A simple fix is to just include the other supported attributes in 'fckplugin.js':
{{{
case 'fck_mw_source' :
    var refLang = htmlNode.getAttribute( 'lang' ) ;
    var refLine = htmlNode.getAttribute( 'line' ) ;
    var refStart = htmlNode.getAttribute( 'start' );
    var refEnclose = htmlNode.getAttribute( 'enclose' );
    var refStrict = htmlNode.getAttribute( 'strict' );

    stringBuilder.push( '<source' ) ;
    stringBuilder.push( ' lang=""' + refLang + '""' ) ;
    stringBuilder.push( ' line=""' + refLine + '""' ) ;
    stringBuilder.push( ' start""' + refStart + '""' ) ;
    stringBuilder.push( ' enclose=""' + refEnclose + '""' ) ;
    stringBuilder.push( ' strict=""' + refStrict + '""' ) ;
    stringBuilder.push( '>' ) ;
    stringBuilder.push( FCKTools.HTMLDecode(htmlNode.innerHTML).replace(/fckLR/g,'\r\n') ) ;
   stringBuilder.push( '</source>' ) ;

   return ;
}}}

Maybe a more general solution would be better, which just includes all the supplied attributes, since you would not have to update this code every time a new one was added. I tried this, but the simple approach got me all the synthetic FCKEditor attributes too.

Best regards,
Ralf 
"	Bug	closed	Normal		Project : MediaWiki+FCKeditor		invalid	HasPatch	
