Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

about scroll sync #691

Closed
shd101wyy opened this issue Nov 28, 2015 · 1 comment
Closed

about scroll sync #691

shd101wyy opened this issue Nov 28, 2015 · 1 comment

Comments

@shd101wyy
Copy link

Hello,

Right now I am trying to implement the scroll sync feature for a markdown editor.

Suppose I have the .md file with content below

### Hello  
this is a markdown file

which produces the html code

<h3>Hello</h3>
<p>this is a markdown file</p>

So I want to map the generated html dom element with my markdown content.
for example, I want the html code to be

<h3 data-line="0">Hello</h3>
<p data-line="1">this is a markdown file</p>

where data-line="0" in <h3 data-line="0">Hello</h3> is from the 0th line of the markdown, which is ### Hello.

data-line="1" in <p data-line="1">this is a markdown file</p> is from the 1th line of the markdown, which is this is a markdown file.

Basically, I want to make a sourcemap (I am not so sure if I am using the correct term though)

Could please give me some suggestions how to do it.

Thank you.

@Feder1co5oave
Copy link
Contributor

See #680

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants