gpt4 book ai didi

android-studio - 换行,KDoc 中的换行

转载 作者:IT老高 更新时间:2023-10-28 13:39:48 30 4
gpt4 key购买 nike

假设我们有这样的记录字符串

/** retrieve a state of the service
* <br/> HTTP code 200 - normal state
* <br/> HTTP code 403 - some recoverable state:
const val SERVICE_STATE = "servicestate" */

有几个 <br/> 在这里,我曾经像在 java 中那样换行,但 AndroidStudio 的输出(在 InteliJIdea 中似乎相同)是 enter image description here

使用 java 可以正确解析和显示:

/** retrieve a state of the service
* <br/> HTTP code 200 - normal state
* <br/> HTTP code 403 - some recoverable state */
public static final String SERVICE_STATE = "servicestate";

enter image description here

我可以用 kotlin 和 IntelijIdea 以某种方式实现相同的效果吗,也许 kotlin 有另一种选择来打破 KDoc 中的界限?

最佳答案

KDoc 格式 uses Markdown syntax而不是 HTML,并且基本的 Markdown 不提供在不开始新段落的情况下换行的方法。

我不知道为什么 Kotlin IntellIJ 插件不支持 <br/>double space hack .

如果开始一个新段落是可以的,跳过一个空行:

/** 
* retrieve a state of the service
*
* HTTP code 200 - normal state
*
* HTTP code 403 - some recoverable state:
*/

结果是:

enter image description here

关于android-studio - 换行,KDoc 中的换行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49558881/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com