MediaWiki master
MediaWiki\Content\CodeHighlighter Class Reference

Service for syntax highlighting. More...

Public Member Functions

 __construct (private readonly ObjectFactory $objectFactory, private readonly array $providerSpecs,)
 
 highlight (string $code, CodeHighlighterOptions $options)
 Highlight the given code based on the given language.
 

Detailed Description

Service for syntax highlighting.

Since
1.47

Definition at line 14 of file CodeHighlighter.php.

Constructor & Destructor Documentation

◆ __construct()

MediaWiki\Content\CodeHighlighter::__construct ( private readonly ObjectFactory $objectFactory,
private readonly array $providerSpecs )

Definition at line 19 of file CodeHighlighter.php.

Member Function Documentation

◆ highlight()

MediaWiki\Content\CodeHighlighter::highlight ( string $code,
CodeHighlighterOptions $options )

Highlight the given code based on the given language.

Parameters
string$codeCode to be syntax-highlighted
CodeHighlighterOptions$optionsOptions for syntax highlighting.
Returns
CodeHighlighterOutput Syntax highlighting output.

Definition at line 45 of file CodeHighlighter.php.


The documentation for this class was generated from the following file: