From dc147a5ef1d5f4bd1d36d90082bdceb9bac8cccf Mon Sep 17 00:00:00 2001 From: Timo Tijhof Date: Sat, 14 Apr 2012 06:08:20 +0200 Subject: [PATCH] Use CSS classes .mw-code and .mw-code-inline - Follows-up I4ff5d0197ba8dc0dad3cafd03f2b120bc22e75cb - Reverts r113190 (redundant fix that caused 35875) - Fixes: * bug 19416 * bug 35875 Change-Id: Iaa2227348ca632d4a261c149bdf2428b4b48adc7 --- SyntaxHighlight_GeSHi.class.php | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/SyntaxHighlight_GeSHi.class.php b/SyntaxHighlight_GeSHi.class.php index 72ec1a70..7c5daa3a 100644 --- a/SyntaxHighlight_GeSHi.class.php +++ b/SyntaxHighlight_GeSHi.class.php @@ -105,24 +105,24 @@ class SyntaxHighlight_GeSHi { // Register CSS $parser->getOutput()->addHeadItem( self::buildHeadItem( $geshi ), "source-{$lang}" ); - if( $wgUseSiteCss ) { + if ( $wgUseSiteCss ) { $parser->getOutput()->addModuleStyles( 'ext.geshi.local' ); } - $encloseTag = $enclose === GESHI_HEADER_NONE ? 'code' : 'pre'; + $encloseTag = $enclose === GESHI_HEADER_NONE ? 'span' : 'div'; $attribs = Sanitizer::validateTagAttributes( $args, $encloseTag ); //lang is valid in HTML context, but also used on GeSHi unset( $attribs['lang'] ); if ( $enclose === GESHI_HEADER_NONE ) { - $attribs = self::addAttribute( $attribs, 'class', 'mw-geshi ' . $lang . ' source-' . $lang ); + $attribs = self::addAttribute( $attribs, 'class', 'mw-geshi mw-code-inline ' . $lang . ' source-' . $lang ); } else { // Default dir="ltr" (but allow dir="rtl", although unsure if needed) $attribs['dir'] = isset( $attribs['dir'] ) && $attribs['dir'] === 'rtl' ? 'rtl' : 'ltr'; - $attribs = self::addAttribute( $attribs, 'class', 'mw-geshi mw-content-' . $attribs['dir'] ); + $attribs = self::addAttribute( $attribs, 'class', 'mw-geshi mw-code mw-content-' . $attribs['dir'] ); } - $out = Xml::tags( $encloseTag, $attribs, $out ); + $out = Html::rawElement( $encloseTag, $attribs, $out ); wfProfileOut( __METHOD__ ); return $out;