Skip to content
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

Incorrect behaviour with trailing slashes with links #6

Closed
SgtCoDFish opened this issue May 5, 2022 · 0 comments
Closed

Incorrect behaviour with trailing slashes with links #6

SgtCoDFish opened this issue May 5, 2022 · 0 comments

Comments

@SgtCoDFish
Copy link

SgtCoDFish commented May 5, 2022

I believe there's a bug in the handling of trailing slashes, e.g. on https://cert-manager.io/docs/usage/gateway/#supported-annotations, there's a link:

[the annotations for Ingress resources](https://cert-manager.io/docs/usage/ingress#supported-annotations/)

The target link is incorrect; the trailing slash is appended after the #supported-annotations fragment but should be placed before it.

This is indicated by the following test, which fails currently (also attached, apply with git apply newtest.txt)

diff --git a/test/remark-plugins/links.test.js b/test/remark-plugins/links.test.js
index 79f90c0..5bb82f6 100644
--- a/test/remark-plugins/links.test.js
+++ b/test/remark-plugins/links.test.js
@@ -128,7 +128,14 @@ const cases = [
     prefix: 'v1.8-docs',
     slug: ['installation', 'helm'],
     expected: '/v1.8-docs/installation/compatibility'
-  }
+  },
+	{
+		url: 'ingress.md#supported-annotation',
+		prefix: 'docs',
+		slug: ['usage', 'gateway'],
+		options: { trailingSlash: true },
+		expected: '/docs/usage/ingress/#supported-annotation',
+	}
 ]
 
 test.each(cases)(

(attached: newtest.txt)

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

No branches or pull requests

2 participants