-
Notifications
You must be signed in to change notification settings - Fork 523
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
feat(docs): add anchor links on description terms #8413
feat(docs): add anchor links on description terms #8413
Conversation
a605a6a
to
1e9cf4a
Compare
This pull request has merge conflicts that must be resolved before it can be merged. |
1e9cf4a
to
28a7286
Compare
c61ef3c
to
22310b3
Compare
0f99668
to
5212f24
Compare
How about:
Update: reverting these suggestions because the PR is inline with the current design on the website |
Yup, I noticed that and came back here to take back my comment/suggestion 🙂 |
@dipikabh while I have your attention, can you please go through |
cc @mdn/mdn-community-engagement since this one is aging. |
Hi, just a gentle reminder about this :) |
Thank you @KartikSoneji, and sorry for the long review time! 🙏 |
Now there is no way to recognize actual links: For |
@OnkarRuikar Good catch, can you open an issue for that? |
Done #9810 |
#8413 introduced a regression, making it hard to identify description terms (`<dt>`) that link to another page. This restores the style of those links, excluding anchor links, and also makes the hashtag of the anchor links interactive. Co-authored-by: Onkar Ruikar <[email protected]>
if (firstDtChild) { | ||
dtChildren.unshift( | ||
h(node, "a", { "data-link-to-id": "true" }, [firstDtChild]) | ||
); |
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 don't think it is ideal that this modifies the Markdown engine. It would be better if the Markdown just produced a clean <dl>
, and this extra feature were implemented on top of the HTML output.
(basically, when we are talking about "MDN markdown", the fewer additions to GFM we have to talk about, the better.)
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 don't think it is ideal that this modifies the Markdown engine. It would be better if the Markdown just produced a clean
<dl>
, and this extra feature were implemented on top of the HTML output.
I don't disagree. @wbamberg Do you mind opening an issue for this?
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.
Fair point, I'll look into it.
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.
Thank you @KartikSoneji . I didn't say, but should have, that this is a really nice feature, and thank you for adding it :).
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.
Thanks!
Not sure if you remember but you reviewed it the first time around too: #3428
Summary
Fixes: #8394
Problem
There is no easy way to link to an element of a description list
Solution
Automatically add
<a>
tags with href pointing to the<dt>
's idScreenshots
(on hover)
Before
After