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

Option to check links in code blocks #73

Open
Nutomic opened this issue Apr 20, 2023 · 2 comments
Open

Option to check links in code blocks #73

Nutomic opened this issue Apr 20, 2023 · 2 comments

Comments

@Nutomic
Copy link

Nutomic commented Apr 20, 2023

Is your feature request related to a problem? Please describe.
We have some links that are inside of code blocks, particularly to download config files as part of an installation process. It is important that these links are correct, but unfortunately mlc ignores them.

Describe the solution you'd like
A command line option to check links inside of code blocks.

Describe alternatives you've considered
Moving the links out of code blocks. This is not a good solution because its necessary to mention the specific commands for users who are not familiar with Linux/bash.

Additional context
Example:

# download default config files
wget https://raw.githubusercontent.com/LemmyNet/lemmy/release/v0.17/docker/prod/docker-compose.yml
wget https://raw.githubusercontent.com/LemmyNet/lemmy/release/v0.17/docker/lemmy.hjson

# start the server
docker-compose up -d
@becheran
Copy link
Owner

I can definitely see how this feature can be useful. Though I am not sure how exactly this should look like.

Right now every code block is simply ignored. I think it doesn't make much sense to parse for markdown links in a code block since it is most likely not markdown but some arbitrary other syntax.

So my question would then be how to detect a link in code blocks? Simply by scanning the text for http(s):// strings? Would that be enough?

@Nutomic
Copy link
Author

Nutomic commented Apr 23, 2023

Yes exactly, scanning for http(s):// strings would be perfect for my purposes. If you want to make it more flexible you could also add a command line parameter for the url protocols that are checked in code blocks. But maybe thats not worth the effort.

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