logo       

[Bug 20010] New: Glossary: Multiple HTML tags in output: msg#02991

wikibugs-l

Subject: [Bug 20010] New: Glossary: Multiple HTML tags in output

https://bugzilla.wikimedia.org/show_bug.cgi?id=20010

Summary: Glossary: Multiple HTML tags in output
Product: MediaWiki extensions
Version: any
Platform: All
OS/Version: All
Status: NEW
Severity: critical
Priority: Normal
Component: General/Unknown
AssignedTo: wikibugs-l@xxxxxxxxxxxxxxxxxxx
ReportedBy: hickseydr@xxxxxxxxxxxxxxx


From
http://www.mediawiki.org/wiki/Extension:Glossary#Multiple_HTML_tags_in_output

**NOTE that the proposed solution below is a little bit ugly... there is
probably a better way of doing the same thing**


The Glossary plugin will create multiple <html> tags within the same output
page which is invalid and causes undefined browser rendering behaviour. This
has been reproduced with MediaWiki 1.15.0 and is caused by ParserBeforeTidy
only parsing the user content of the page (rather than the entire HTML output
that is sent to the client). To resolve this problem, open up Glossary.php and
find:

if (glossaryParseThisNode($doc, $doc->documentElement, $term)) {

And replace it with:

$body_element = $doc->getElementsByTagName('body')->item(0);
if (glossaryParseThisNode($doc, $body_element, $term)) {

Then a few lines down, find:

$doc->documentElement->appendChild($span);

And replace with:

$body_element->appendChild($span);

Finally, find:

$text = $doc->saveHTML();

And insert the following immediately below:

$text = substr($text, strpos($text, '<body>'), -16);


--
Configure bugmail: https://bugzilla.wikimedia.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
You are on the CC list for the bug.

_______________________________________________
Wikibugs-l mailing list
Wikibugs-l@xxxxxxxxxxxxxxxxxxx
https://lists.wikimedia.org/mailman/listinfo/wikibugs-l

<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | Mail Home | sitemap | FAQ | advertise