diff --git a/extensions/markdown/media/main.js b/extensions/markdown/media/main.js index 51709d145bb20..dc9250386851b 100644 --- a/extensions/markdown/media/main.js +++ b/extensions/markdown/media/main.js @@ -146,7 +146,7 @@ } else { scrollTo = previous.element.getBoundingClientRect().top; } - window.scroll(0, window.scrollY + scrollTo + getSourceRevealAddedOffset()); + window.scroll(0, Math.max(1, window.scrollY + scrollTo + getSourceRevealAddedOffset())); } }