Page MenuHomePhabricator

Geshi CSS styles not included in Code Review
Closed, DeclinedPublic

Description

Is the parser output only partially used?
$parser->mOutput->addHeadItem( self::buildHeadItem( $geshi ), "source-{$lang}" );


Version: unspecified
Severity: minor
URL: http://www.mediawiki.org/wiki/Special:Code/MediaWiki/52676#c3073

Details

Reference
bz19474

Event Timeline

bzimport raised the priority of this task from to Low.Nov 21 2014, 10:41 PM
bzimport set Reference to bz19474.
bzimport added a subscriber: Unknown Object (MLST).

Not sure I understand this; geshi syntax highlighting isn't used on this page that I can see, so it's not surprising that the geshi styles aren't being pulled in?

When using <source> tags in review comments, they are not coloured.

The HTML output for comments is fetched via $wgOut->parse(), which throws away any head items or ResourceLoader modules specified in the ParserOutput object.

Without redoing the entire output code for the code review pages, this might work:

  • change out $wgOut->parse() for
  • call $wgOut->addParserOutputNoText($parserOutput) to add styles/etc
    • note this will pass through language links and category links as well. Alternate: just do the head items/addModules but this feels icky.
  • fetch the HTML with $parserOutput->getText() and use as before
  • Bug 27710 has been marked as a duplicate of this bug. ***

(In reply to comment #3)

The HTML output for comments is fetched via $wgOut->parse(), which throws away
any head items or ResourceLoader modules specified in the ParserOutput object.

Without redoing the entire output code for the code review pages, this might
work:

  • change out $wgOut->parse() for
  • call $wgOut->addParserOutputNoText($parserOutput) to add styles/etc
    • note this will pass through language links and category links as well.

Alternate: just do the head items/addModules but this feels icky.

  • fetch the HTML with $parserOutput->getText() and use as before

Care to elaborate a bit more Brion?

Was just looking at this, and the idea doesn't seem complete...

ie Which parser output instance you are using, etc

Ta! :)