mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/SyntaxHighlight_GeSHi
synced 2024-11-23 22:13:40 +00:00
Fix lexer list parsing on Windows
When using a non-bundled Pygments (which is required on Windows, as the
bundled version is an ELF binary), we call into the Pygments executable
to generate the list of supported languages (lexers). This list seems to
occasionally include carraige returns, causing some languages to not be
processed correctly. Trim those CRs out so the language list is
accurate.
Bug: T336087
Change-Id: If8b1f145dd10e2c4707d6d32927e85d1d2459f15
(cherry picked from commit 2ae82c7fb7
)
This commit is contained in:
parent
29d6f65f18
commit
57b3580811
|
@ -56,7 +56,7 @@ class UpdateLexerList extends Maintenance {
|
|||
$output = $result->getStdout();
|
||||
foreach ( explode( "\n", $output ) as $line ) {
|
||||
if ( substr( $line, 0, 1 ) === '*' ) {
|
||||
$newLexers = explode( ', ', trim( $line, "* :\n" ) );
|
||||
$newLexers = explode( ', ', trim( $line, "* :\r\n" ) );
|
||||
// Skip internal, unnamed lexers
|
||||
if ( $newLexers[0] !== '' ) {
|
||||
$lexers = array_merge( $lexers, $newLexers );
|
||||
|
|
Loading…
Reference in a new issue