I fixed this issue we had:
In particular, loose lists … like this were bust in preview and code blocks were bust:
But … this regresses onebox support so the fix is no good.
In the interim I have disabled preview sync until we can clean up the pipeline.
In particular, layering on stuff to baked html is done in the wrong spot. The converter should be the one adding the markers and data returned from the converter should be untouched. This is both more efficient and less fragile. This means you need to work through markdown js and ensure it is extensible in this way. Intermediate presentation should have line# metadata, final render should add the markers.
Additionally there needs to be some logic to deal with dropped markers cause that will happen. eg multiline
No rush on this feature, we can not afford to regress any functionality for it.
Markdown js extensiblity is a priority for us anyway so improving it is something that can help us in other cases anyway.