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/column numbers in renderer #441

Closed
sidorares opened this issue Jun 23, 2014 · 9 comments
Closed

Line/column numbers in renderer #441

sidorares opened this issue Jun 23, 2014 · 9 comments

Comments

@sidorares
Copy link

I'm generating javascript code from .md files and would like to build source map along the way. Is there any way to get line/column number at the moment when renderer handler is invoked?

@sidorares
Copy link
Author

oops, should have used search first - partially duplicate of #382

Though this one is more specific - I only need location data and going to build sourcemap manually in my code which uses marked.

@sbruchmann
Copy link

Other partially duplicates are #296 and #338

@skeggse
Copy link

skeggse commented Jul 25, 2014

Yes please :)

I tried doing something with a counter on a custom renderer which increments for each listitem and clears for the list, but that doesn't handle nested lists.

@sidorares
Copy link
Author

I have a work around for my use case: add line number to a language name in fenced code start and then later replace language name back to original (say, renderer is called with code:coffee-123 - this is coffee block starting at line 123, we can combine sourcemap to include this code at offset 123)

@puzrin
Copy link

puzrin commented Oct 23, 2014

@sidorares, take a look at https://github.com/jonschlinkert/remarkable . It already has line numbers support for all blocks. We did not implemented columns, because could not find real use cases. Also everything can be monkeypatched.

@bpasero
Copy link

bpasero commented Aug 14, 2015

+1

@andr2
Copy link

andr2 commented Nov 13, 2015

Added a pull-request with partial resolution: #680

@Twwy
Copy link

Twwy commented Dec 20, 2015

@andr2
thanks
It's really useful.

@joshbruce
Copy link
Member

#983

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

8 participants