dokka
dokka copied to clipboard
[K2] KDoc references that goes after markdown blocks don't have links
class JavaNetCookieJar
interface CookieJar {
/**
* Markdown syntax ```code```
* This references doesn't work: [System.currentTimeMillis] and [JavaNetCookieJar].
*/
fun saveFromResponse(url: String)
}
In K1, references are resolved:
In K2 are not:
If I put a reference before the code block in the samples, it will be resolved. Also, if it the same as reference after, like:
/**
* This references works: [System.currentTimeMillis] and [JavaNetCookieJar]
* Markdown syntax ```code```
* This references doesn't work: [System.currentTimeMillis] and [JavaNetCookieJar].
*/
The both will be resolved.
Installation
- Dokka version: 1.9.20
Parent: https://github.com/Kotlin/dokka/issues/3328
One more case. Reference works in K1 and doesn't in K2
interface Call
/**
* @param text some description with reference.
* But with a few lines and indent [Call]
*/
fun protocol(text: String) {}
Note Both cases do not work in IDE K1:
They lead to an internal error in IDE:
There is a problem in a parser of compiler (PSI). see https://github.com/JetBrains/kotlin/blob/master/compiler/psi/src/org/jetbrains/kotlin/kdoc/lexer/KDoc.flex
There is a workaround on Dokka's side: to resolve KDoc links like in K1.
The second case with @param
I would expect to work, but line breaks in KDoc tags are not specified by the KDoc spec, so it might require additional work from the compiler / analysis API.
The first case with code blocks might be invalid markdown, we need to check the spec.
Markdown file parsing should be fixed (module/package descriptions)