[01:19:51] [telegram] Does anyone know how to hack into CodeMirror from a userscript? I want to highlight a single character, namely " " (nbsp). It does not seem to be in the default styles listed here https://meta.wikimedia.org/wiki/Community_Tech/Wikitext_editor_syntax_highlighting#Color_and_style_customization , so I need to define it somehow [01:22:34] [telegram] (I am javascript-1 at best, so trying to figure it out by reading https://phabricator.wikimedia.org/diffusion/ECMI/browse/master/resources/mode/mediawiki/mediawiki.js is tough) [03:00:38] [telegram] something suggests me that it would be easier if eatWikiText wasn't 200+ lines [03:02:07] [telegram] I've defined a custom mode: [03:02:08] [telegram] $.when(window.CodeMirror).then(function(){ [03:02:09] [telegram] console.log('When code mirror was executed'); [03:02:11] [telegram] ( function ( CodeMirror ) { [03:02:12] [telegram] CodeMirror.defineMode( 'mw-char-nbsp', function ( /* config, parserConfig */ ) { [03:02:14] [telegram] return { [03:02:15] [telegram] startState: function () { return {}; }, [03:02:17] [telegram] token: function(stream){ [03:02:18] [telegram] console.log('Custom token function is executed'); [03:02:20] [telegram] if(stream.eat( /[Ґ]+/ )){ [03:02:21] [telegram] return 'mw-char-nbsp'; [03:02:23] [telegram] } [03:02:24] [telegram] } [03:02:26] [telegram] }; [03:02:27] [telegram] }); [03:02:29] [telegram] console.log('Custom codemirror code was indeed called fro Base\'s vector.js'); [03:02:30] [telegram] }( window.CodeMirror ) ) [03:02:32] [telegram] }); [03:02:33] [telegram] Not sure if correctly, but the problem is that it is never called from the mediawiki one… [03:02:45] [telegram] I've defined a custom mode: [03:02:45] [telegram] $.when(window.CodeMirror).then(function(){ [03:02:47] [telegram] console.log('When code mirror was executed'); [03:02:48] [telegram] ( function ( CodeMirror ) { [03:02:50] [telegram] CodeMirror.defineMode( 'mw-char-nbsp', function ( /* config, parserConfig */ ) { [03:02:51] [telegram] return { [03:02:53] [telegram] startState: function () { return {}; }, [03:02:54] [telegram] token: function(stream){ [03:02:56] [telegram] console.log('Custom token function is executed'); [03:02:57] [telegram] if(stream.eat( /[\u00a0]+/ )){ [03:02:59] [telegram] return 'mw-char-nbsp'; [03:03:00] [telegram] } [03:03:02] [telegram] } [03:03:03] [telegram] }; [03:03:05] [telegram] }); [03:03:06] [telegram] console.log('Custom codemirror code was indeed called fro Base\'s vector.js'); [03:03:08] [telegram] }( window.CodeMirror ) ) [03:03:09] [telegram] }); [03:03:11] [telegram] Not sure if correctly, but the problem is that it is never called from the mediawiki one… [03:29:30] [telegram] There also seems to be https://phabricator.wikimedia.org/T181677 for this particular character, but it would be good to know what is an API to do the task from a userscript anyway. [03:35:10] [telegram] Oh, but the patch modifies https://phabricator.wikimedia.org/diffusion/ECMI/browse/master/resources/ext.CodeMirror.js and I totally missed this file 😅 Something to check after sleep I guess [06:26:24] [telegram] 非小号关注 电报推特脸书ins油管拉人增粉点赞 : https://tools-static.wmflabs.org/bridgebot/ba46e254/file_933.jpg [11:25:00] [telegram] Mmmm... Can anyone git fetch from Wikimedia Gerrit? I can open the website, but when I try git fetch, I see [11:25:00] [telegram] Connection to gerrit.wikimedia.org closed by remote host. [11:25:02] [telegram] fatal: the remote end hung up upon initial contact [12:27:33] [telegram] worked for me just now (in mediawiki/core.git) (re @amire80: Mmmm... Can anyone git fetch from Wikimedia Gerrit? I can open the website, but when I try git fetch, I see [12:27:33] [telegram] Connection to gerrit.wikimedia.org closed by remote host. [12:27:35] [telegram] fatal: the remote end hung up upon initial contact)