mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
e4e8f8e076
The content of the SyntaxHighlight extension is not wikitext and annotations should be stripped from it before rendering. Bug: T341009 Depends-On: I4e9a7a8bec3cb9532ef8a729fd2c6c4acca5d8a0 Change-Id: Ibada54d517830b1112b59513b090dc4bbdc7c917
42 lines
975 B
PHP
42 lines
975 B
PHP
<?php
|
|
|
|
declare( strict_types = 1 );
|
|
|
|
namespace MediaWiki\SyntaxHighlight;
|
|
|
|
use Wikimedia\Parsoid\Ext\ExtensionModule;
|
|
|
|
class ParsoidExt implements ExtensionModule {
|
|
|
|
/** @inheritDoc */
|
|
public function getConfig(): array {
|
|
return [
|
|
'name' => 'SyntaxHighlight',
|
|
'tags' => [
|
|
[
|
|
'name' => 'source',
|
|
'handler' => SyntaxHighlight::class,
|
|
'options' => [
|
|
// Strip nowiki markers from #tag parser-function arguments.
|
|
// This will be used to resolve T299103.
|
|
// This is primarily a b/c flag in Parsoid.
|
|
'stripNowiki' => true,
|
|
'hasWikitextInput' => false,
|
|
]
|
|
],
|
|
[
|
|
'name' => 'syntaxhighlight',
|
|
'handler' => SyntaxHighlight::class,
|
|
'options' => [
|
|
// Strip nowiki markers from #tag parser-function arguments.
|
|
// This will be used to resolve T299103.
|
|
// This is primarily a b/c flag in Parsoid.
|
|
'stripNowiki' => true,
|
|
'hasWikitextInput' => false,
|
|
]
|
|
]
|
|
]
|
|
];
|
|
}
|
|
}
|