This repository was archived by the owner on May 12, 2026. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ function buildStyle (
5353 codeBlockFontFamily ,
5454 lineNumber ,
5555 scrollPastEnd ,
56+ optimizeOverflowScroll ,
5657 theme ,
5758 allowCustomCSS ,
5859 customCSS
@@ -86,12 +87,14 @@ function buildStyle (
8687 url('${ appPath } /resources/fonts/MaterialIcons-Regular.woff') format('woff'),
8788 url('${ appPath } /resources/fonts/MaterialIcons-Regular.ttf') format('truetype');
8889}
90+
8991${ markdownStyle }
9092
9193body {
9294 font-family: '${ fontFamily . join ( "','" ) } ';
9395 font-size: ${ fontSize } px;
94- ${ scrollPastEnd && 'padding-bottom: 90vh;' }
96+ ${ scrollPastEnd ? 'padding-bottom: 90vh;' : '' }
97+ ${ optimizeOverflowScroll ? 'height: 100%;' : '' }
9598}
9699@media print {
97100 body {
@@ -341,6 +344,7 @@ export default class MarkdownPreview extends React.Component {
341344 codeBlockFontFamily ,
342345 lineNumber ,
343346 scrollPastEnd ,
347+ false ,
344348 theme ,
345349 allowCustomCSS ,
346350 customCSS
@@ -663,16 +667,19 @@ export default class MarkdownPreview extends React.Component {
663667 this . getWindow ( ) . document . getElementById (
664668 'codeTheme'
665669 ) . href = this . GetCodeThemeLink ( codeBlockTheme )
670+
666671 this . getWindow ( ) . document . getElementById ( 'style' ) . innerHTML = buildStyle (
667672 fontFamily ,
668673 fontSize ,
669674 codeBlockFontFamily ,
670675 lineNumber ,
671676 scrollPastEnd ,
677+ true ,
672678 theme ,
673679 allowCustomCSS ,
674- customCSS
680+ customCSS ,
675681 )
682+ this . getWindow ( ) . document . documentElement . style . overflowY = 'hidden'
676683 }
677684
678685 GetCodeThemeLink ( name ) {
You can’t perform that action at this time.
0 commit comments