File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,14 +29,20 @@ function displayData(data: any, whiteBg: boolean): Promise<HTMLElement> {
2929 const results = ( window as any ) . JUPYTER_DATA as any [ ] ;
3030 ( window as any ) . __dirname = rootDirName ;
3131 try {
32- const color = decodeURIComponent ( window . location . search . substring ( window . location . search . indexOf ( '?color=' ) + 7 , window . location . search . indexOf ( '&fontFamily=' ) ) ) ;
32+ let color = decodeURIComponent ( window . location . search . substring ( window . location . search . indexOf ( '?color=' ) + 7 ) ) ;
33+ color = color . substring ( 0 , color . indexOf ( '&fontFamily=' ) ) ;
3334 if ( color . length > 0 ) {
3435 window . document . body . style . color = color ;
3536 }
36- const fontFamily = decodeURIComponent ( window . location . search . substring ( window . location . search . indexOf ( '&fontFamily=' ) + 12 ) ) ;
37+ let fontFamily = decodeURIComponent ( window . location . search . substring ( window . location . search . indexOf ( '&fontFamily=' ) + 12 ) ) ;
38+ fontFamily = fontFamily . substring ( 0 , fontFamily . indexOf ( '&fontSize=' ) ) ;
3739 if ( fontFamily . length > 0 ) {
3840 window . document . body . style . fontFamily = fontFamily ;
3941 }
42+ const fontSize = decodeURIComponent ( window . location . search . substring ( window . location . search . indexOf ( '&fontSize=' ) + 10 ) ) ;
43+ if ( fontSize . length > 0 ) {
44+ window . document . body . style . fontSize = fontSize ;
45+ }
4046 }
4147 catch ( ex ) {
4248 }
Original file line number Diff line number Diff line change @@ -142,14 +142,16 @@ export class TextDocumentContentProvider extends Disposable implements vscode.Te
142142 function start(){
143143 var color = '';
144144 var fontFamily = '';
145+ var fontSize = '';
145146 try {
146147 computedStyle = window.getComputedStyle(document.body);
147148 color = computedStyle.color + '';
148149 fontFamily = computedStyle.fontFamily;
150+ fontSize = computedStyle.fontSize;
149151 }
150152 catch(ex){
151153 }
152- document.getElementById('myframe').src="proxy.php?url=https%3A%2F%2Fgithub.com%2Falugarius%2FpythonVSCode%2Fcommit%2F%3Cspan+class%3D"pl-s1">${ vscode . Uri . file ( htmlFileName ) . toString ( ) } ?color=' + encodeURIComponent(color) + "&fontFamily=" + encodeURIComponent(fontFamily);
154+ document.getElementById('myframe').src="proxy.php?url=https%3A%2F%2Fgithub.com%2Falugarius%2FpythonVSCode%2Fcommit%2F%3Cspan+class%3D"pl-s1">${ vscode . Uri . file ( htmlFileName ) . toString ( ) } ?color=' + encodeURIComponent(color) + "&fontFamily=" + encodeURIComponent(fontFamily) + "&fontSize=" + encodeURIComponent(fontSize) ;
153155 }
154156 </script>
155157 </head>
You can’t perform that action at this time.
0 commit comments