dokka
dokka copied to clipboard
Square brackets are not rendered correctly in formulas by MathJax
Describe the bug
Brackets are dropped in formulas. For example, \[f[x]\] is rendered not as $f[x]$ but as $fx$.
Expected behaviour Brackets are not dropped in formulas.
Screenshots
To Reproduce
- Add the MathJax plugin to usual dokka configuration.
- Add any top-level function with docstring
/** * \[f[x]\] * * @usesMathJax */ - Compile the documentation.
Dokka configuration Configuration of dokka used to reproduce the bug
dependencies {
dokkaPlugin("org.jetbrains.dokka:mathjax-plugin:1.8.10")
}
Installation
- Operating system: Windows
- Build tool: Gradle v8.1.1
- Dokka version: 1.8.10
Are you willing to provide a PR? Sorry, but no.
By KDoc, [x] is treated as a link to element x.
Meanwhile, Dokka should generate \] and \[ in HTML to display MathJax.
Current workaround - to use HTML escaping, e.g. for [ ([):
/**
* \[f[x]\]
*
* @usesMathJax
*/
Escaping in Kdoc should be discussed further so I left this issue.
https://youtrack.jetbrains.com/issue/KT-24840/Square-bracket-escaping-in-KDoc