Skip to content

fix: ignore gitlab table of content in wikilinks#1710

Merged
mre merged 2 commits intolycheeverse:masterfrom
JayJayArr:#1708
May 23, 2025
Merged

fix: ignore gitlab table of content in wikilinks#1710
mre merged 2 commits intolycheeverse:masterfrom
JayJayArr:#1708

Conversation

@JayJayArr
Copy link
Contributor

fixes #1708

Comment on lines +68 to +71
//Ignore gitlab toc notation: https://docs.gitlab.com/user/markdown/#table-of-contents
if ["_TOC_".to_string(), "TOC".to_string()].contains(&dest_url.to_string()) {
return None;
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure, but have you tried

if ["_TOC_", "TOC"].contains(&dest_url.as_str()) {

Would save a few allocs.

Copy link
Contributor Author

@JayJayArr JayJayArr May 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds very good!
...but is apparently not stabilized yet: rust-lang/rust#130366
Is would be possible with as_ref like

if ["_TOC_", "TOC"].contains(&dest_url.as_ref()) {

but this might break in the future: rust-lang/rust#130366 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, you really did some soul-searching to dig this up. Nice research. ❤️
All good then.

@mre
Copy link
Member

mre commented May 22, 2025

Thanks for the fix! One little thingy. 😃

@mre mre merged commit 7d9d797 into lycheeverse:master May 23, 2025
6 checks passed
@mre mre mentioned this pull request May 23, 2025
@JayJayArr JayJayArr deleted the #1708 branch May 24, 2025 19:44
@mre mre mentioned this pull request May 25, 2025
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

Successfully merging this pull request may close these issues.

Incorrect missing "_TOC_" file errors in latest Docker images

2 participants