Hi,
the following problem: htmlcode is ignored
$body.=wfElement('label',array(),wfMsg('naw-page-1-label-1'));
Output: Gib hier Bitte einen <strong>aussagekräftigen</strong> a.s.o.
regards mic
On 14/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
Hi,
the following problem: htmlcode is ignored
$body.=wfElement('label',array(),wfMsg('naw-page-1-label-1'));
Output: Gib hier Bitte einen <strong>aussagekräftigen</strong>
Intentional; the XML building functions (wfElement() et al. have now been deprecated in favour of Xml::element() et al.) will escape contents, attributes, etc. to ensure it's all appropriate for inclusion in XHTML.
To generate an element with unescaped contents, use Xml::tags() (where available), or wfOpenElement() and wfCloseElement().
In general, label text shouldn't be permitted to contain arbitrary HTML, as this can cause validation errors. Your actual problem here is that the message isn't defined, and the default is therefore <naw-page-1-label-1> which is escaped. Fix that.
Rob Church
Rob Church schrieb:
On 14/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
Hi,
the following problem: htmlcode is ignored
$body.=wfElement('label',array(),wfMsg('naw-page-1-label-1'));
Output: Gib hier Bitte einen <strong>aussagekrÀftigen</strong>
Intentional; the XML building functions (wfElement() et al. have now been deprecated in favour of Xml::element() et al.) will escape contents, attributes, etc. to ensure it's all appropriate for inclusion in XHTML.
To generate an element with unescaped contents, use Xml::tags() (where available), or wfOpenElement() and wfCloseElement().
In general, label text shouldn't be permitted to contain arbitrary HTML, as this can cause validation errors. Your actual problem here is that the message isn't defined, and the default is therefore <naw-page-1-label-1> which is escaped. Fix that.
Rob Church _______________________________________________ MediaWiki-l mailing list MediaWiki-l@lists.wikimedia.org http://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hi Rob
thanks for the hint, but I make a test ...
$body.=xml::element('p',array(),wfMsg('naw-page-1-label-1'));
$allMessages["de"]["naw-page-1-label-1"]="Gib hier Bitte einen <strong>aussagekräftigen</strong> Title für die Seite an.<br /> Der ursprünglich gewählte Titel kann auch nochmal verändert werden.";
the out: Gib hier Bitte einen <strong>aussagekräftigen</strong> Title für die Seite an.<br /> Der ursprünglich gewählte Titel kann auch nochmal verändert werden.
Your actual problem here is that the message isn't defined, and the default is therefore <naw-page-1-label-1> which is escaped. Fix that.
it's obvious, that the message ist definied. I take a look at the xml.class:
$out .= '>' . htmlspecialchars( $contents ) . "</$element>";
regards mic
On 14/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
it's obvious, that the message ist definied. I take a look at the xml.class:
Actually, no, it wasn't - the escaped junk you were receiving is what MediaWiki's message-handing functions return when asked to fetch a message that the message cache is unable to retrieve. You do need to register messages appropriately - see the dozens of extensions in Subversion which do so.
Can you explain what your actual problem is? There is nothing wrong with the XML-building methods as far as I am aware. You haven't indicated whether you've tried using the suggested Xml::tags() or any other workaround.
Rob Church
On 14/09/2007, Rob Church robchur@gmail.com wrote:
On 14/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
it's obvious, that the message ist definied. I take a look at the xml.class:
Actually, no, it wasn't - the escaped junk you were receiving is what MediaWiki's message-handing functions return when asked to fetch a message that the message cache is unable to retrieve. You do need to register messages appropriately - see the dozens of extensions in Subversion which do so.
It's outputting the message correctly, it's not outputting junk, it's outputting German ;). The message is a German phrase including <strong> tags>. The problem is simply that those tags are escaped - the solution you gave should fix it.
Thomas Dalton schrieb:
On 14/09/2007, Rob Church robchur@gmail.com wrote:
On 14/09/2007, Michael Heyder Info@hafenvolleyballer.de wrote:
it's obvious, that the message ist definied. I take a look at the xml.class:
Actually, no, it wasn't - the escaped junk you were receiving is what MediaWiki's message-handing functions return when asked to fetch a message that the message cache is unable to retrieve. You do need to register messages appropriately - see the dozens of extensions in Subversion which do so.
It's outputting the message correctly, it's not outputting junk, it's outputting German ;). The message is a German phrase including <strong> tags>. The problem is simply that those tags are escaped - the solution you gave should fix it.
Thomas,
well xml::tags() seems to be not implemented on my wiki version. I'm working on Wiki 1.9.1. It is used as a MIS on a intranet solution. So, it's not recommanded to update this to a actual version.
regards mic
thanks for the hint, but I make a test ...
$body.=xml::element('p',array(),wfMsg('naw-page-1-label-1'));
The hint was not to use xml::element, but to use xml:tags instead. wfElement is just a deprecated alias for xml:element, they're pretty much interchangeable.
mediawiki-l@lists.wikimedia.org