Replies: 2 comments 8 replies
-
There is an extension that adds position information to the tokens: https://github.com/UziTech/marked-token-position Would that be helpful? |
Beta Was this translation helpful? Give feedback.
2 replies
-
I added marked-token-position to my program to try it out, and it threw an error message. I've attached the full error message as a file along with a minimal source. What seems odd about the error message is that it says it cannot find a substring even though the substring is present in the original source... The part that throws the error is markdown processed by marked-more-lists. |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I was wondering if it was possible for an extension to determine the line number, in the markdown source, where the current 'src' string (given as an argument to the tokenizer) can be found. This would be useful for implementing an inverse-search from the HTML viewer back to the markdown source in an editor.
I've implemented a proof of concept by defining an extension which matches syntax of the form "[Edit N]" (where N is an integer) in the source and turns it into a hyperlink of the form:
And I've configured my Mac so that when the link is clicked on in a web browser, Sublime Text opens the specified file at line N. So that all works great.
Right now, I have to manually type "[Edit N]", explicitly specifying the line number, wherever I want the inverse search functionality to be provided. It would be nice to automate this, but that requires being able to determine the line number in the markdown source from the extension.
Any help would be much appreciated!
Jason
Beta Was this translation helpful? Give feedback.
All reactions