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

URLs in markdown code blocks being incorrectly checked #117

Closed
wolf99 opened this issue May 14, 2022 · 7 comments
Closed

URLs in markdown code blocks being incorrectly checked #117

wolf99 opened this issue May 14, 2022 · 7 comments

Comments

@wolf99
Copy link
Contributor

wolf99 commented May 14, 2022

The PR lycheeverse/lychee#523 seems to indicate that code blocks in markdown will be ignored.

However this is not happening when I add this action in a workflow here: git-ecosystem/git-credential-manager#700

For example the localhost or contoso links are reported as failures. Those examples use fenced code block, indent code block, and inline code markdown formatting. Per these examples:

```
https://example.com
```

    https://example.com

`https://example.com`

Have I done something wrong?

@wolf99
Copy link
Contributor Author

wolf99 commented May 14, 2022

Th following is also "correctly" caught as a broken link.
Is there a way to avoid all file:// type links?

https://github.com/GitCredentialManager/git-credential-manager/blob/46d1b3cc31a385b44f071a37a888c563c83adb59/src/osx/Installer.Mac/resources/en.lproj/conclusion.html#L14

@wolf99 wolf99 changed the title URLs in markdown code blocks being checked URLs in markdown code blocks being incorrectly checked May 14, 2022
@wolf99
Copy link
Contributor Author

wolf99 commented May 14, 2022

Just realised I have created this PR on the Lychee repo, but I am seeing this with the Lychee Action.
Can someone move this to that repo if that is the correct place?

@mre mre transferred this issue from lycheeverse/lychee May 14, 2022
@mre
Copy link
Member

mre commented May 14, 2022

Code blocks only get excluded when setting the --include-verbatim flag You need to set that in the args of the lychee-action in your pipeline.
That's a new feature and I need to make a new lychee release first. Also see #116.

@wolf99
Copy link
Contributor Author

wolf99 commented May 15, 2022

Oh, maybe I misunderstood the discussion on --include-verbatim in the other issues.

You're saying that including things verbatim actually then excludes some things (such as code blocks)?
The documentation shows: Find links in verbatim sections like `pre`- and `code` blocks, which is the opposite of what I would like.

From your comment: lycheeverse/lychee#523 (comment)

The reason is that we will exclude verbatim links (inside pre and code) by default.

Which is what I actually would like, but that doesn't seem to be happening.

I had thought this was already the default case as I have the action running correctly on another project which I think does this OK (though I can't recall if there are any links in code blocks in that project).

@mre
Copy link
Member

mre commented May 15, 2022

Sorry for the confusion, my bad. What I meant was that the newest version of lychee already excludes code blocks by default, so no need to do anything. 😅

@wolf99
Copy link
Contributor Author

wolf99 commented May 15, 2022

Thanks that's what I expected.
However if you see the link for the ci run in my initial post, that is not happening; instead it is checking, and failing, on lots of example links within markdown code sections.

@mre
Copy link
Member

mre commented May 15, 2022

The lychee version of lychee-action is not up to date. I need to release a new version first.

@wolf99 wolf99 closed this as completed May 15, 2022
StevenMaude added a commit to opensafely/documentation that referenced this issue May 31, 2022
This continues to check code blocks. It was the previous behaviour, but
changed in lychee.

The v1.5.0 lychee action has an updated lychee, which now supports and
enforces this flag now.

See lycheeverse/lychee-action#116 and lycheeverse/lychee-action#117.
StevenMaude added a commit to opensafely/documentation that referenced this issue May 31, 2022
This checks links in code blocks.

It was the previous default lychee behaviour by default, but recently
changed. So we need to enable this to continue these checks, as we've
now updated the lychee action (#758).

See lycheeverse/lychee-action#116 and lycheeverse/lychee-action#117.
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