This repository was archived by the owner on Jan 3, 2023. It is now read-only.

Description
So, as discussed in #104, I'm opening an issue for this.
As far as I can gather, there are a few options with how to go about this.
- Scroll to percentage, i.e. if source is at x% from top, scroll preview to x% from top. That's what I ended up with in markdown-preview-pandoc. Not ideal, especially for image-heavy documents.
- Embed raw html anchors near all block-level elements before passing source to pandoc. This is theoretically doable, but for it to work, you'll need to actually parse source markdown to find block-level elements in the first place. It would have to be pandoc-flavored markdown to boot, so probability of finding a library for this is slim.
- Contribute to pandoc. This should actually be rather simple: add a reader option, and then embed some sort of markers (e.g. raw html anchor) into Pandoc's internal representation on each block-level element. That would be passed through to writer, where you could use it to your advantage. I have a general idea of how this should be done, so I could slap together a proof of concept, if needed. Drawback is we'll need to get this into pandoc, and then wait for next release, and this can take a while.
There are probably other ways of getting this to work, but I can't think of those.