Alex Monk has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/311839

Change subject: VE: Ensure ext.pygments module gets loaded when a user adds a 
syntax highlight node
......................................................................

VE: Ensure ext.pygments module gets loaded when a user adds a syntax highlight 
node

Otherwise it won't get styled unless VE was loaded on a read page with one 
existing.

Change-Id: I32c02eda1e7dca077340c2bf3c15aadad7e3b61a
---
M modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js
1 file changed, 4 insertions(+), 1 deletion(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SyntaxHighlight_GeSHi 
refs/changes/39/311839/1

diff --git a/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js 
b/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js
index 4176d1e..f4acf6c 100644
--- a/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js
+++ b/modules/ve-syntaxhighlight/ve.ce.MWSyntaxHighlightNode.js
@@ -30,11 +30,14 @@
 
 /** */
 ve.ce.MWSyntaxHighlightNode.prototype.generateContents = function () {
+       var node = this, args = arguments;
        if ( !this.getModel().isLanguageSupported() ) {
                return $.Deferred().reject().promise();
        }
        // Parent method
-       return ve.ce.MWExtensionNode.prototype.generateContents.apply( this, 
arguments );
+       return mw.loader.using( 'ext.pygments' ).then( function () {
+               return ve.ce.MWExtensionNode.prototype.generateContents.apply( 
node, args );
+       } );
 };
 
 /** */

-- 
To view, visit https://gerrit.wikimedia.org/r/311839
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32c02eda1e7dca077340c2bf3c15aadad7e3b61a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SyntaxHighlight_GeSHi
Gerrit-Branch: master
Gerrit-Owner: Alex Monk <a...@wikimedia.org>

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to