Bug: Fail on invalid aliases with anchors #17

Closed
opened 2025-03-11 13:10:02 +01:00 by mdbenito · 4 comments
mdbenito commented 2025-03-11 13:10:02 +01:00 (Migrated from github.com)

Adding anchors to invalid aliases results in exceptions thrown instead of gracefully failing.

To reproduce, add this to a document:


[[this-just-fails|Some bad reference]]
[[this-fails#catastrophically|Some bad reference]]
[[#this-breaks-it-again|Some bad anchor]]

I'll have a PR ready in a few minutes with a solution!

Adding anchors to invalid aliases results in exceptions thrown instead of gracefully failing. To reproduce, add this to a document: ```markdown [[this-just-fails|Some bad reference]] [[this-fails#catastrophically|Some bad reference]] [[#this-breaks-it-again|Some bad anchor]] ``` I'll have a PR ready in a few minutes with a solution!
joapuiib commented 2025-04-01 21:35:21 +02:00 (Migrated from github.com)

Just ran into this problem too.

It would be great to have tests for controlling invalid aliases as well. I'll try to add some cases when I find some time.

Just ran into this problem too. It would be great to have tests for controlling invalid aliases as well. I'll try to add some cases when I find some time.
mdbenito commented 2025-04-02 12:32:22 +02:00 (Migrated from github.com)

I had totally forgotten about this 😅 It seems I also forgot to link the PR to the issue.

I had totally forgotten about this 😅 It seems I also forgot to link the PR to the issue.
joapuiib commented 2025-04-27 21:41:14 +02:00 (Migrated from github.com)

I've added a PR #19 that adds some tests for this failing cases.

After merging #18, tests should pass.

I've added a PR #19 that adds some tests for this failing cases. After merging #18, tests should pass.
mdbenito commented 2025-08-27 12:44:43 +02:00 (Migrated from github.com)

@EddyLuten Any chance #18 and #19 can be merged?

@EddyLuten Any chance #18 and #19 can be merged?
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
luten/mkdocs-alias-plugin#17
No description provided.