Closed nreid260 closed 1 year ago
This should be fixed in 1.5.8. (I'm also trying to put it into ktfmt; https://github.com/facebook/ktfmt/pull/372 )
Will this introduce ambiguity with other tools (e.g. Dokka)? It might be better to force users to insert escapes, if they'll get weird results otherwise.
I did an experiment and Dokka seems to also ignore unterminated link texts.
In case it's useful, the way I'm doing these experiments is to have a checkout of the dokka git repo, examples/gradle/dokka-gradle-example/src/main/kotlin/demo/HelloWorld.kt and then I run
$ ./gradlew dokkaHtml
$ open ./build/dokka/html/\-dokka\ \-gradle\ \-example/\[root\]/index.html
Overall though, is there a reporting API in ktfmt to report problems with the source code? I'm thinking I should add that here; there are a number of cases where we can tell the markup is wrong, but we can't auto fix it -- and in those cases it would be nice to alert the user.
The following KDoc formats in an unfortunate way:
It seems that the
[
begins a markdown link, which is never closed and so consumes the rest of the text in an unbreakable line. This is in contrast to the "human" interpretation, where)
terminates a numeric interval.Probably, this is a limitation of trying to use markdown for code comments, and the solution is to have the user add an escape
\[
.