-
Notifications
You must be signed in to change notification settings - Fork 590
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
Add the version into all links in the docs if it exists. #4334
Conversation
pxtlib/docsrender.ts
Outdated
const relative = href.indexOf('/') == 0; | ||
const target = !relative ? '_blank' : ''; | ||
if (relative && d.versionPath) href = `/${d.versionPath}${href}`; | ||
return `<a href="${href}" ${title ? `aria-label="${title}"` : ''} ${target ? `target="${target}"` : ''}>${text}</a>`; |
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.
are these strings escaped already?
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.
This comment looks good: markedjs/marked#655 (comment)
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.
Good find. I'll use that comment instead and patch in my fix.
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.
Ensure proper encoding and sanization of links
Fixed. |
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Adds vN to all links rendered by the markdown if it exists. We also add the vN prefix for all links in the docs sidemenu.
Reason for changes, if you start browsing on makecode.microbit.org/vN you want to stay browsing on that site, rather than switch to latest.