Last modified: 2013-09-01 10:39:26 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 T25708, the corresponding Phabricator task for complete and up-to-date bug report information.
Bug 23708 - Monospace text still much smaller in Vector for certain extensions
Monospace text still much smaller in Vector for certain extensions
Status: RESOLVED DUPLICATE of bug 26204
Product: MediaWiki
Classification: Unclassified
Interface (Other open bugs)
1.16.x
All All
: Normal normal (vote)
: ---
Assigned To: Trevor Parscal
:
Depends on: 20706
Blocks: 44881
  Show dependency treegraph
 
Reported: 2010-05-30 05:58 UTC by Gérard
Modified: 2013-09-01 10:39 UTC (History)
7 users (show)

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


Attachments
Screenshot of small font issue (3.21 KB, image/png)
2010-05-30 16:01 UTC, Gérard
Details

Description Gérard 2010-05-30 05:58:48 UTC
This report is related to bugreport number 20706. It occurs using Firefox 3.6.3, the vector skin and extensions SyntaxHighLight_GesHi and HeaderTabs. I use mw16beta3 plus the latest (from the nightly build) vector skin date (may 30). 

The small font issue seems to persist in combination with certain extensions.

HeaderTabs: With version 0.7 of this extension the effect was that the font in the edit screen wasn't courier anymore. Setting it to monospace (user preference) showed a very small courier font. Adding tag "textarea" to the already proposed tt, code and pre fix solved this problem. (see this extensions talk page).

 tt, code, pre, textarea {
   font-family: monospace, sans-serif;
 }

SyntaxHighLight_GesHi: With the latest version of this extension all the preformatted text shows in colour but again in very small font. I have not been able to repair it with any temporary solution in Mediawiki:Vector.css
Comment 1 Gérard 2010-05-30 16:01:46 UTC
Created attachment 7417 [details]
Screenshot of small font issue
Comment 2 Gérard 2010-06-11 04:43:53 UTC
I found a temporary work-a-round for SyntaxHighLight_GesHi:
1) Update to the latest php files of the extension
2) Do not use the new Geshi files but use the older geshi version: 1.0.7.22
Then the small font issue doesn't occur in the vector skin (using Firefox).

----
Probable cause:
There is a difference in the generated html that geshi.php produces:

Version 1.0.7.22 (still ok):

var $overall_style = '';
var $code_style = 'font-family: \'Courier New\', Courier, monospace; font-weight: normal; font-style: normal;';

Version 1.0.8.7 (nok):
var $overall_style = 'font-family:monospace;';
var $code_style = 'font: normal normal 1em/1.2em monospace; margin:0; padding:0; background:none; vertical-align:top;';



Maybe this helps narrowing down the search for the problem.
Comment 3 entlinkt 2010-06-17 22:52:59 UTC
This is essentially the same as bug 23951. See explanations there.

The culprit is the SyntaxHighlight GeSHi extension adding style="font-family: monospace;" everywhere. As http://www.brunildo.org/test/monospace_fsize.html shows, this is the most harmful thing to do because "font-family: monospace;" is the only thing that triggers the tiny fonts in *all* browsers that have the problem. In some browsers it can be worked around by adding something else at any position of the list (even if that "something" is actually a monospaced font), in others it can be worked around by adding a generic family at the end.

By adding style="font-family: monospace;" as inline style attribute, the SyntaxHighlight GeSHi extension invalidates the workaround that has been added to the Vector skin to fix bug 20706. It can be overridded with something like

pre.css.source-css,               /* MediaWiki:*.css, User:*.css */
pre.javascript.source-javascript, /* MediaWiki:*.js, User:*.js */
div.mw-geshi pre,                 /* source enclose="pre" */
div.mw-geshi div,                 /* source enclose="div" */
span.mw-geshi                     /* source enclose="none" */ {
	font-family: monospace, sans-serif !important;
}

The place to fix it is the SyntaxHighlight GeSHi extension itself. It should stop adding "font-family: monospace;" all over the place and rely on HTML elements that imply it and leave it up to browsers and skins to deal with them. It could wrap everything that it doesn't wrap into a pre element into a tt element. Or, more semantic, wrap everything into a code element and then even further into a pre, div or nothing (yes, wrapping a code element into a pre element makes sense).
Comment 4 entlinkt 2010-06-18 11:02:04 UTC
Wrapping GeSHi's output into <code> elements is also suggested in bug 17147. For other reasons, though, and that alone won't suffice: It would also have to drop all instances of "font-family: monospace;".
Comment 5 Gérard 2010-06-22 04:23:50 UTC
Thanks for your extensive comment and helpful links. I have added a MediaWiki:Geshi.css page to my wiki with the suggested code:

pre.css.source-css,               /* MediaWiki:*.css, User:*.css */
pre.javascript.source-javascript, /* MediaWiki:*.js, User:*.js */
div.mw-geshi pre,                 /* source enclose="pre" */
div.mw-geshi div,                 /* source enclose="div" */
span.mw-geshi                     /* source enclose="none" */ {
    font-family: monospace, sans-serif !important;
}

Now sourcecode shows properly in a page with Firefox and the newest version of Geshi.

This solves the issue reported in the bug. I think this bugreport can be closed.
Comment 6 Roan Kattouw 2010-06-22 12:39:35 UTC
(In reply to comment #5)
> This solves the issue reported in the bug. I think this bugreport can be
> closed.

Resolving as FIXED per reporter.
Comment 7 entlinkt 2010-06-23 07:03:14 UTC
This is not "fixed" as it still needs rather ugly local adaptions to avoid the tiny fonts. Duping to bug 17147 because the underlying issue is that Geshi cannot easily be styled like <code> although it *is* code.

*** This bug has been marked as a duplicate of bug 17147 ***
Comment 8 Helder 2012-03-04 13:55:08 UTC
Reopening because of bug 17147 comment 2.
Comment 9 Erwin Dokter 2013-09-01 10:39:26 UTC
Reclosing as duplicate. Generic monospace bug has been fixed long ago in bug 20706. GeSHi issue still open in bug 26204.

*** This bug has been marked as a duplicate of bug 26204 ***

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


Navigation
Links