Skip to content

Conversation

vmishenev
Copy link
Contributor

Note: a quoted name is rendered as inlined code.

@vmishenev vmishenev linked an issue Sep 1, 2025 that may be closed by this pull request
@vmishenev vmishenev requested a review from whyoleg September 1, 2025 10:51
@whyoleg
Copy link
Collaborator

whyoleg commented Sep 2, 2025

Here is how the following links are rendered on master (and Dokka 2.1.0-Beta):

/**
 * [`Quoted Class Name`]
 * [`test%^!@#_me`]
 * [String.length]
 * [`String.length`]
 * [String]
 * [String.`length`]
 * [`String.`length``]
 * [`hexToByteArray`]
 */
image

Should we create an additional issue to decide how such cases should be rendered? #3719 could be related.

(cc @berezinant just in case you might have discussed such cases during code-blocks rework)

@whyoleg
Copy link
Collaborator

whyoleg commented Sep 2, 2025

@vmishenev K2 tests are failing with metaspace error. Could you investigate?
I see that it fails in our new DokkaBootstrap implementation.

@vmishenev vmishenev merged commit 9914d4c into master Sep 3, 2025
13 of 14 checks passed
@vmishenev vmishenev deleted the vmishenev/3356-Add-test-link-to-a-class-with-quoted-name branch September 3, 2025 11:04
@vmishenev
Copy link
Contributor Author

K2 tests are failing with metaspace error. Could you investigate?

#4244

Should we create an additional issue to decide how such cases should be rendered?

As for me, it looks logical. Or do you have a proposal?

@whyoleg
Copy link
Collaborator

whyoleg commented Sep 5, 2025

As for me, it looks logical. Or do you have a proposal?

I don't have a direct proposal, but it feels weird that we mix Kotlin syntax to reference quoted declarations with Markdown syntax for inline code blocks. I understand why this happens: [xxx] is a shorthand for [xxx][xxx], and so one is resolved based on Kotlin syntax, and the other based on Markdown syntax, where we have different meanings for backticks.

Here, I would expect all of the examples to render consistently:

  • All declarations rendered as inline code or not at all.
  • In case the declaration name requires backticks (has spaces), those backticks should be rendered.

JIC, here is what it looks like in the latest IDEA with support for backticks in KDoc:

image

And I do really like how it's done there; it's consistent.

I'm still not quite understanding why this is resolved:

`String.length`

But that's a question for the KDoc parser (probably also needs an issue)

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.

[K2] Reference to a class with quoted name is not resolved
2 participants