ChatText (消息文本)

把消息的 text + entities 渲染出来:粗体、斜体、剧透(点击揭开)、行内代码与带语言标签可复制的代码块、引用块、链接与提及。不走 v-html,实体树由 ui-core 的纯函数生成,Flutter 端照同一算法移植。

基础用法

entities 的偏移与长度按 UTF-16 code unit 计,嵌套任意层;交叉、越界、切开 emoji 的区间都会先被 normalizeKunChatEntities 规整,所以任何数据都能渲染。

《星空鉄道とシロの旅》 补丁更新了,主线 已经 完整 汉化,番外还在路上 番外下月补齐。 安装说明见 补丁页,有问题 @鲲。
转区后再启动,不然会乱码。
启动命令:
shell
LANG=ja_JP.UTF-8 wine "Game.exe"
存档在 %APPDATA%/StarRail 下面。
Basic.vue

剧透

通关了!最后的反转是 列车长就是白本人,而且 第三章那封信 早就暗示过了。
Spoiler.vue

单行预览

雪之下小春结局是 !强烈推荐,攻略见 论坛wine Game.exe
Preview.vue

接管链接与提及

点一下链接或提及
Events.vue

输入框快捷写法

parseKunChatMarkdown 把输入框里的 **粗** __斜__++下划线++ ~~删~~ ||剧透|| `代码````语言⏎代码⏎``` [文字](链接) [文字](mention:ID) 与行首 > 引用转成 text + entities;formatKunChatMarkdown 反过来, 编辑已发消息或恢复草稿时用。两者互逆(url 实体由服务端重新识别,不写回)。

属性

属性类型默认值说明
text *string—Message text.
entitiesKunChatEntity[] | nullnullFormatting ranges over `text`, in UTF-16 code units. Normalized before rendering, so malformed input renders instead of throwing.
previewbooleanfalseOne-line summary rendering for previews (conversation rows, reply and pinned bars): blocks flatten inline, links are plain text, spoilers are masked so their text is not in the DOM at all.

事件

事件回调参数说明
linkurl: string, event: MouseEventA link was clicked. It opens in a new tab unless you call `event.preventDefault()`, e.g. to route an in-site URL.
mentionuserId: string, event: MouseEventA mention was clicked. It is a real link to the profile (`userLinkTemplate`); call `event.preventDefault()` to handle it yourself.