Skip to content

about scroll sync #691

Closed
Closed

Description

@shd101wyy

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.

Activity

  1. Feder1co5oave commented on Jan 10, 2018

    @Feder1co5oave
    Contributor

    See #680

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

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions