Last modified: 2011-05-23 14:13:16 UTC

Wikimedia Bugzilla is closed!

Wikimedia migrated from Bugzilla to Phabricator. Bug reports are handled in Wikimedia Phabricator.
This static website is read-only and for historical purposes. It is not possible to log in and except for displaying bug reports and their history, links might be broken. See T29756, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 27756 - When viewing diffs, syntax highlight is not being applyed anymore on preview
When viewing diffs, syntax highlight is not being applyed anymore on preview
Status: RESOLVED FIXED
Product: MediaWiki extensions
Classification: Unclassified
FlaggedRevs (Other open bugs)
unspecified
All All
: Low minor with 1 vote (vote)
: ---
Assigned To: Sam Reed (reedy)
https://secure.wikimedia.org/wikipedi...
: patch, patch-need-review
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-02-27 01:02 UTC by Helder
Modified: 2011-05-23 14:13 UTC (History)
6 users (show)

See Also:
Web browser: ---
Mobile Platform: ---
Assignee Huggle Beta Tester: ---


Attachments
Best guess at bug (1.48 KB, patch)
2011-03-08 23:28 UTC, Sam Reed (reedy)
Details
v2 (1.44 KB, patch)
2011-03-08 23:39 UTC, Sam Reed (reedy)
Details

Description Helder 2011-02-27 01:02:09 UTC
In the diff above, the sections which contains source code in <source lang="php"> tags are not being properly formated (GeSHi). The code is displayed as if it were in <pre> tags.

I believe this is another consequence of the page content being loaded via AJAX (bug 25289). See also another similar bug:
https://secure.wikimedia.org/wikipedia/mediawiki/w/index.php/?diff=386071&oldid=367003
Comment 1 db [inactive,noenotif] 2011-02-27 18:33:33 UTC
That is right, some javascript previews has the same problem (bug 24134, bug 24162).

That are the "headitems" of action=parse (bug 22061).
Comment 2 Sam Reed (reedy) 2011-03-08 23:28:54 UTC
Created attachment 8271 [details]
Best guess at bug
Comment 3 Krinkle 2011-03-08 23:34:53 UTC
using innerHTML += causes the html to be re-entered, dom elements re-created etc. could cause unexpected behaviour + would break any events to elements in there (although that's probably rare in the <head>).

use appendChild instead ( or $('head').append( htmlcodehere ) ).

And, although not specific to this patch, using JSON instead of XML from the API is probably a good idea.
Comment 4 Sam Reed (reedy) 2011-03-08 23:39:28 UTC
Created attachment 8272 [details]
v2
Comment 5 Sam Reed (reedy) 2011-03-08 23:45:06 UTC
r83552
Comment 6 Aaron Schulz 2011-05-23 14:13:16 UTC
Fixed in r88639.

Note You need to log in before you can comment on or make changes to this bug.


Navigation
Links