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

Include line number in report of failed link. #23

Open
reagle opened this issue Sep 10, 2020 · 6 comments
Open

Include line number in report of failed link. #23

reagle opened this issue Sep 10, 2020 · 6 comments

Comments

@reagle
Copy link

reagle commented Sep 10, 2020

It'd be nice if it included the line number in the report of failed link.

@blink1073
Copy link
Contributor

Hi @reagle! I not sure if this is possible since we convert the documents to html prior to checking the links. The actual link url might not even be in the original document.

@reagle
Copy link
Author

reagle commented Sep 11, 2020

Ah, I see. I appreciate that this worked on markdown but I can see the problem. I was hoping I could set a pattern in iTerm such that clicking on it opened it in my editor (as I do with Python exceptions) or could even use in my editor (as I do with linting). How do you do the conversion?

@blink1073
Copy link
Contributor

We do the conversion here and then parse the document here. We might be able to get the line number from the parsed html, but at that point we don't know what type the original document was.

@reagle
Copy link
Author

reagle commented Sep 11, 2020

The only hack I can think of is to preprocess the markdown line number as an attribute prior to conversion. Using pandoc's syntax for link attributes, something like:

"""
image{#id .class width=30 height=20px ln=23}
"""

A more generic approach would to be use something like pandoc to parse the AST and check link types there. The new commonmark parser in commonmark-hs is supposed to have source information which could yield line numbers....?

@blink1073
Copy link
Contributor

I don't have the bandwidth to work on this, but would support something along these lines.

@reagle
Copy link
Author

reagle commented Sep 11, 2020

Fair enough. I'm not prepared to take this on myself.

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

2 participants