ahmetb / gen-crd-api-reference-docs

API Reference Docs generator for Kubernetes CRDs (used by Knative, Kubeflow and others)
Apache License 2.0
303 stars 99 forks source link

HTML packages produces urlencoded %2f #33

Open squakez opened 3 years ago

squakez commented 3 years ago

Hi there. We noticed that the output generated is producing a %2f encoded value instead of a /. That's not a problem for a browser but it can be a problem for any tool looking for validity of references. In our case, it can't validate the page because it thinks it misses the links.

<p>Packages:</p>
<ul>
<li>
<a href="#camel.apache.org%2fv1alpha1">camel.apache.org/v1alpha1</a>
</li>
<li>
<a href="#camel.apache.org%2fv1">camel.apache.org/v1</a>
</li>
</ul>
<h2 id="camel.apache.org/v1alpha1">camel.apache.org/v1alpha1</h2>

An easy workaround we're using is to replace the encoded value, so, the check is not failing anymore.

ahmetb commented 3 years ago

I think we did that on purpose because the slashes were not working properly (and they're harder to parse in URLs).

squakez commented 3 years ago

Yeah, I think you can consider a minor issue as it does not affect directly the user experience. However I wonder why this %2f is only present in the Packages section and the rest of html document is using normal / in the hrefs.

ahmetb commented 3 years ago

argh my memory doesn't serve me as to why we added urlencode. technically you can have id with / and hrefs to that as urlencoded version of it. (see recent PRs/commits) the links should still work?