mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-27 15:50:37 +00:00
Merge "Parsoid DOM compatibility for links and copy buttons"
This commit is contained in:
commit
ea888d62df
|
@ -40,6 +40,7 @@ use ParserOptions;
|
||||||
use RuntimeException;
|
use RuntimeException;
|
||||||
use TextContent;
|
use TextContent;
|
||||||
use WANObjectCache;
|
use WANObjectCache;
|
||||||
|
use Wikimedia\Parsoid\Core\ContentMetadataCollectorStringSets as CMCSS;
|
||||||
use Wikimedia\Parsoid\DOM\DocumentFragment;
|
use Wikimedia\Parsoid\DOM\DocumentFragment;
|
||||||
use Wikimedia\Parsoid\Ext\ExtensionTagHandler;
|
use Wikimedia\Parsoid\Ext\ExtensionTagHandler;
|
||||||
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
|
use Wikimedia\Parsoid\Ext\ParsoidExtensionAPI;
|
||||||
|
@ -198,7 +199,7 @@ class SyntaxHighlight extends ExtensionTagHandler implements
|
||||||
$parser->addTrackingCategory( $cat );
|
$parser->addTrackingCategory( $cat );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Register CSS
|
// Register modules
|
||||||
$parser->getOutput()->addModuleStyles( self::getModuleStyles() );
|
$parser->getOutput()->addModuleStyles( self::getModuleStyles() );
|
||||||
$parser->getOutput()->addModules( [ 'ext.pygments.view' ] );
|
$parser->getOutput()->addModules( [ 'ext.pygments.view' ] );
|
||||||
return $result['html'];
|
return $result['html'];
|
||||||
|
@ -213,8 +214,9 @@ class SyntaxHighlight extends ExtensionTagHandler implements
|
||||||
// FIXME: There is no API method in Parsoid to add tracking categories
|
// FIXME: There is no API method in Parsoid to add tracking categories
|
||||||
// So, $result['cats'] is being ignored
|
// So, $result['cats'] is being ignored
|
||||||
|
|
||||||
// Register CSS
|
// Register modules
|
||||||
$extApi->addModuleStyles( self::getModuleStyles() );
|
$extApi->getMetadata()->appendOutputStrings( CMCSS::MODULE_STYLE, self::getModuleStyles() );
|
||||||
|
$extApi->getMetadata()->appendOutputStrings( CMCSS::MODULE, [ 'ext.pygments.view' ] );
|
||||||
|
|
||||||
return $extApi->htmlToDom( $result['html'] );
|
return $extApi->htmlToDom( $result['html'] );
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue