4 ms·
I posted this in the other thread, so I apologize if it's redundant. I agree, auto-scrolling the preview panel is important. In my personal blog, I didn't use
by bhauer 14y ago
I posted this in the other thread, so I apologize if it's redundant. I agree, auto-scrolling the preview panel is important. In my personal blog, I didn't use Markdown, but rather just plain HTML (with some minor tweaks). What I did to synchronize the editor and preview was:
1. Find the shortest path out of a currently-edited tag (look to see if the cursor is between a nearby set of < and > characters). In most cases, the cursor is not in a tag, so this is not needed.
2. Insert an empty marker span.
3. Find that span in the preview pane.
4. Find the span's parent block, add a class to that block to highlight it, and then scroll to its location.
Seen here: http://tiamat.tsotech.com/images/tiamat-authoring-2012-10.png http://tiamat.tsotech.com/images/tiamat-authoring-2012-10.pn... (the yellow paragraph at the bottom right)