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

Line Number #3

Closed
F1LT3R opened this issue Jul 25, 2020 · 1 comment
Closed

Line Number #3

F1LT3R opened this issue Jul 25, 2020 · 1 comment

Comments

@F1LT3R
Copy link

F1LT3R commented Jul 25, 2020

Is there a way to get the line number the block starts at rather than the string position?

@F1LT3R
Copy link
Author

F1LT3R commented Jul 26, 2020

Never mind, this should do:

const lineNumber = markdownContent.slice(0, block.start).split('\n').length;

@F1LT3R F1LT3R closed this as completed Jul 26, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant