typedoc-plugin-markdown icon indicating copy to clipboard operation
typedoc-plugin-markdown copied to clipboard

TypeDoc generates broken links for `{@linkcode ...}` comments

Open mrousavy opened this issue 1 year ago • 9 comments

Hey! Thanks for this amazing plugin, I use TypeDoc to generate API documentation for react-native-vision-camera! ❤️

I am using {@linkcode } blocks, (see code here), but for some reason the output links are broken:

Exhaustive list of all broken links found
-> linking to CameraDeviceFormat.md#maxfps (resolved as: /docs/api/interfaces/CameraDeviceFormat.md)

Screenshot 2023-10-10 at 18 15 16

Is there any way to configure that? Or am I using {@linkcode ...} wrong?

mrousavy avatar Oct 10 '23 16:10 mrousavy

(The problem is the .md suffix, it needs to be generated without .md, then it's a valid link)

mrousavy avatar Oct 10 '23 16:10 mrousavy

The issue occurs only when there's many {@linkcode ...} statements close by, weirdly if I add text inbetween those links it compiles fine...

mrousavy avatar Oct 10 '23 16:10 mrousavy

So I have done a bit of digging and {@linkcode} is parsing correctly but there does seem to be a Docusaurus bug in resolving broken links when a link is immediately followed by a parenthesis.

broken: [label](page.md#anchorName) (see [label](page.md#anchorName))

ok: see ([label](page.md#anchorName))

ok: [label](page.md#anchorName) - (see [label](page.md#anchorName))

tgreyuk avatar Oct 20 '23 17:10 tgreyuk

Interesting! Thanks for your insights, I guess this should be reported in the Docusaurus repo then?

mrousavy avatar Oct 23 '23 08:10 mrousavy

I guess this should be reported in the Docusaurus repo then?

Yes I think so - I'll do a bit more investigation and raise a ticket.

tgreyuk avatar Oct 23 '23 15:10 tgreyuk

Awesome, thank you I appreciate it! 🙏

mrousavy avatar Oct 23 '23 17:10 mrousavy

@tgreyuk - I am also experiencing this bug. Have you made a ticket?

bo-carey avatar Nov 08 '23 18:11 bo-carey

Thanks @bo-carey i was just looking at this and i notice you have already raised a ticket. I am linking to it here as a reference - https://github.com/facebook/docusaurus/issues/9518 .

tgreyuk avatar Nov 19 '23 23:11 tgreyuk

@tgreyuk thanks for that, Tom!

bo-carey avatar Nov 20 '23 13:11 bo-carey

Have tested and I can confirm that this issue has been fixed in Docusaurus 3.4. https://github.com/facebook/docusaurus/pull/10168.

tgreyuk avatar Jun 25 '24 23:06 tgreyuk