Skip to content

Conversation

@gmelikov
Copy link

@gmelikov gmelikov commented Sep 14, 2025

This basic PR have several atomic commits:

  • support anchors in .md links
  • scroll to anchors on full page load
  • small trailing spaces cleanup

Feel free to remove latest commit about spaces cleanup, it's totally optional.

Closes: #11 #10

@netlify
Copy link

netlify bot commented Sep 14, 2025

Deploy Preview for ocispecs ready!

Name Link
🔨 Latest commit
🔍 Latest deploy log https://app.netlify.com/projects/ocispecs/deploys/68c6b44a58aae2b2a4f1c574
😎 Deploy Preview https://deploy-preview-12--ocispecs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@vsoch
Copy link
Collaborator

vsoch commented Sep 14, 2025

Thanks @gmelikov! I'm testing and I don't visibly notice any behavior change. Can you walk me through your logic?

@gmelikov
Copy link
Author

gmelikov commented Sep 14, 2025

@vsoch I've tested it locally via env JEYLL_ENVIRONMENT=production bundle exec jekyll serve, opened http://127.0.0.1:4000/image-spec/manifest/?v=v1.0.1 and checked that

This section defines the application/vnd.oci.image.manifest.v1+json [media type](https://specs.opencontainers.org/image-spec/media-types/?v=v1.0.1). For the media type(s) that this is compatible with see the [matrix](https://specs.opencontainers.org/image-spec/manifest/media-types.md#compatibility-matrix).

changed to

This section defines the application/vnd.oci.image.manifest.v1+json [media type](http://127.0.0.1:4000/image-spec/media-types/?v=v1.0.1). For the media type(s) that this is compatible with see the [matrix](http://127.0.0.1:4000/image-spec/media-types/?v=v1.0.1#compatibility-matrix).

(see last link with #compatibility-matrix anchor)

Just tested that without my patches I'll have original 404 link http://127.0.0.1:4000/image-spec/manifest/media-types.md#compatibility-matrix instead of correct one http://127.0.0.1:4000/image-spec/media-types/?v=v1.0.1#compatibility-matrix . Maybe I've something wrong and there's different way to run it?

@gmelikov
Copy link
Author

How to reproduce scroll problems: open from scratch http://127.0.0.1:4000/image-spec/media-types/?v=v1.0.1#compatibility-matrix , check that you'll be at the top of page instead of compatibility-matrix section. It may have some races because of images load still, but it's better than nothing. Problem is that browsers scroll to anchor on page load, but we change the page after full load, and we have to scroll manually after that.

@vsoch
Copy link
Collaborator

vsoch commented Sep 14, 2025

Gotcha - thank you for that example. I'm looking at the preview:

And I'm starting at https://specs.opencontainers.org/image-spec/media-types/?v=v1.0.1. I'm using firefox and I don't notice any difference in behavior - when I click in either, it resolves to the same URL and jumps down the page. Is there a different browser I should be using?

Maybe others can test and reproduce.

@gmelikov
Copy link
Author

Do you have correct links here https://specs.opencontainers.org/image-spec/manifest/?v=v1.0.1 ? I've tried to describe my problem here #11 , it's reproducible for me on Linux: firefox 128.14.0esr (64-bit) , chrome Version 140.0.7339.127 (Official Build) (64-bit),

Just to be precise:

This section defines the application/vnd.oci.image.manifest.v1+json media type. For the media type(s) that this is compatible with see the matrix.

Link that you've gave me in #11

$(this).append("<a href='#" + this.id + "' class='pilcrow'>¶</a>")
is about another logic, IIUC, and it doesn't parse original links with anchors, only add another ones.

@gmelikov
Copy link
Author

gmelikov commented Sep 14, 2025

Preview here https://deploy-preview-12--ocispecs.netlify.app/image-spec/manifest/?v=v1.0.1 have code from this PR and works as I intended, JFYI. Major logic to fix #11 is in this commit 78cce33

@gmelikov
Copy link
Author

@st3penta as the reporter of #10 - could you please check if your problems are fixed via this link https://deploy-preview-12--ocispecs.netlify.app/image-spec/manifest/?v=v1.0.1 ?

@sudo-bmitch
Copy link
Contributor

Maybe others can test and reproduce.

@vsoch are you checking the link and not the destination? The link is on https://specs.opencontainers.org/image-spec/manifest/?v=v1.0.1 where the link for "matrix" points to https://specs.opencontainers.org/image-spec/manifest/media-types.md#compatibility-matrix

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

specs.opencontainers.org renderer has problems with link anchors

3 participants