I want to implement a more accurate markdown source code-preview Synchronize scrolling function.
I know you can achieve proportional Synchronize scrolling by operating scrollTop, but this is not accurate enough. I want to be able to press "Line" to scroll Synchronize (Synchronize preview similar to vscode: the first element at the top of the preview window, corresponding to the first line of code at the top of the source window).
react-markdown has an option called sourcePos
to include the location of the corresponding source code in the output element, but what I do is lightweight and I don"t want to rely on react.
so I"d like to ask, are there any other options?
PS: my markdown source editor has adopted monaco editor