# NIP08

## 处理提及

`final` `optional` `author:fiatjaf` `author:scsibug`

本文档标准化了客户端对 S 内容 `text_note` 中的其他事件和公钥的内联提及的处理。

想要允许标记的提及的客户端必须在用户开始键入特殊键（例如"@"）或按下某个按钮以包括提及等时显示自动完成组件或类似的组件--或者这些客户端可以想出其他方法来明确区分提及和正常文本。

一旦标识了提及，例如 pubkey `27866e9d854c78ae625b867eefdfa9580434bc3e675be08d2acb526610d96fbe`，客户端必须将该 pubkey 添加到带有标记 `p` 的中 `.tags`，然后将其文本引用（内部 `.content`）替换为其中" index "等于标记数组中相关标记的基于 0 的索引的符号 `#[index]`。

同样的过程也适用于提及事件 ID.

在其 `.content` 中接收 `text_note` 具有这种 `#[index]` 提及的事件的客户端可以使用来自具有所提及的实际公钥或事件 ID 的 `.tags` 数组的实际内容来进行搜索和替换，在该过程中进行它想要的任何期望的上下文扩充（例如，链接到公钥或显示所提及的事件内容的预览）。

如果 `#[index]` 具有 `index` 超出标记数组范围的标记，或者指向不 `e` 是或 `p` 标记或以其他方式声明为支持此表示法的标记，则客户端不得执行此类替换或扩充，而是将其显示为普通文本。


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://sherry-pang.gitbook.io/nostr-cn/fu-lu-1-nip-xiang-jie/08.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
