Skip to content

🔍 Do not treat wiki permalinks as wiki-links for now #1959

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

Merged
merged 5 commits into from
May 28, 2025

Conversation

agoose77
Copy link
Contributor

To fix #1954, we need to understand permalinks. I don't have time right now to add support for transforming and understanding permalinks, as this will likely require support in myst-theme too. This PR, instead, just silences any warnings by not touching permalinks and instead treating them as regular old links.

@agoose77 agoose77 requested a review from rowanc1 April 10, 2025 09:21
Copy link

changeset-bot bot commented Apr 10, 2025

🦋 Changeset detected

Latest commit: 1d62ad4

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
myst-transforms Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@@ -20,7 +20,7 @@ export function formatLinkText(link: Link) {
if (link.children?.length !== 1 || link.children[0].type !== 'text') return;
const url = link.children[0].value;
// Add an exception for wiki transforms links.
if (url.length < 20 || url.match(/\s/) || url.startsWith('wiki:')) return;
Copy link
Member

@rowanc1 rowanc1 Apr 14, 2025

Choose a reason for hiding this comment

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

I think this should stay?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The other changes in this PR that generalise link formatting should ensure that this function is only called when its required (i.e., not for wiki links)

@agoose77
Copy link
Contributor Author

@rowanc1 is this OK to ship?

@rowanc1
Copy link
Member

rowanc1 commented May 23, 2025

Will get to this by Monday or you can merge.

@agoose77
Copy link
Contributor Author

As per the above comment, I'm merging this. I think it's a safe merge -- it generalises our link formatting mechanism, and adds a special case for permalinks so that they are treated as regular hyperlinks for now.

@agoose77 agoose77 added the bug Something isn't working label May 28, 2025
@agoose77 agoose77 merged commit 9184fc0 into main May 28, 2025
8 of 9 checks passed
@agoose77 agoose77 deleted the agoose77/fix-wiki-heuristic branch May 28, 2025 09:06
@rowanc1
Copy link
Member

rowanc1 commented May 29, 2025

Thanks. :)

At our continuous science workshop this week.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wiki link heuristic does not understand permalinks
2 participants