shd101wyy / vscode-markdown-preview-enhanced

One of the "BEST" markdown preview extensions for Visual Studio Code
https://shd101wyy.github.io/markdown-preview-enhanced
Other
1.48k stars 173 forks source link

[BUG] 遇到超长定义列表但最后没有普通文本时预览展示位置与编辑位置严重不一致 #1957

Open Alanclaude opened 8 months ago

Alanclaude commented 8 months ago

Describe the bug 打开Zen mode后遇到超长定义列表但最后没有普通文本时预览展示位置与编辑位置严重不一致 The preview display position and the edit position are seriously inconsistent when the long "definition list" is encountered

Environment

To Reproduce Steps to reproduce the behavior:

  1. 打开zen mode
  2. 新建一个空md文件并打开预览
  3. 写入大于一页的普通文本
  4. 写入大于一页的定义列表
  5. 滚动编辑区视图
  6. 当向下滚动到定义列表页面时观察到预览页面反向向上滚动

English veision

  1. Enable Zen mode
  2. Create an empty md file and open preview
  3. Write regular text larger than a page
  4. Write a definition list larger than one page
  5. Scrolling the editor view
  6. Watch the preview page scroll back up when scrolling down to the definition list page

Expected behavior 编辑与预览位置正常对应 The edit and preview positions correspond normally

Markdown file Please attach the markdown file that can reproduce the bug. test.md

Screenshots If applicable, add screenshots to help explain your problem. image

Additional context Add any other context about the problem here.

shd101wyy commented 8 months ago

这个是 scroll sync 的问题。我现在也没有好的解决方案,我建议你可以在某些地方插入些 comment。comment 会创建锚点

test
: test
: test

<!-- anchor -->

test
: test
:test