-
Notifications
You must be signed in to change notification settings - Fork 99
🔍 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
Conversation
🦋 Changeset detectedLatest commit: 1d62ad4 The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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; |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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)
@rowanc1 is this OK to ship? |
Will get to this by Monday or you can merge. |
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. |
Thanks. :) At our continuous science workshop this week. |
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.