答案文本支持的 Markdown 格式
自定义问答将答案文本存储为 markdown。 有很多不同形式的 Markdown。 为了确保返回并正确显示答案文本,请使用此参考。
使用 CommonMark 教程验证 Markdown。 此教程具有用于快速复制/粘贴验证的试一试功能。
何时使用富文本编辑而不是 Markdown
借助答案的富文本编辑,你(作者)可以使用格式设置工具栏快速选择文本并设置其格式。
当需要自动生成内容以创建要作为 CI/CD 管道的一部分导入或用于批量测试的项目时,Markdown 是更好的工具。
支持的 Markdown 格式
下面是答案文本可以使用的 Markdown 格式的列表。
用途 | 格式 | 示例 Markdown |
---|---|---|
2 个句子之间的新行。 | \n\n |
How can I create a bot with \n\n custom question answering? |
从 h1 到 h6 的标头,# 数指示是哪个标头。 1 # 为 h1。 |
\n# text \n## text \n### text \n####text \n#####text |
## Creating a bot \n ...text.... \n### Important news\n ...text... \n### Related Information\n ....text... \n# my h1 \n## my h2\n### my h3 \n#### my h4 \n##### my h5 |
斜体 | *text* |
How do I create a bot with *custom question answering*? |
强调(粗体) | **text** |
How do I create a bot with **custom question answering***? |
链接的 URL | [text](https://www.my.com) |
How do I create a bot with [custom question answering](https://language.cognitive.azure.cn/)? |
*公共图像的 URL |  |
How can I create a bot with  |
删除线 | ~~text~~ |
some ~~questions~~ questions need to be asked |
粗体和斜体 | ***text*** |
How can I create a ***custom question answering**** bot? |
链接的粗体 URL | [**text**](https://www.my.com) |
How do I create a bot with [**custom question answering**](https://language.cognitive.azure.cn/)? |
链接的斜体 URL | [*text*](https://www.my.com) |
How do I create a bot with [*custom question answering*](https://language.cognitive.azure.cn/)? |
转义 Markdown 符号 | \*text\* |
How do I create a bot with \*custom question answering*\*? |
有序列表 | \n 1. item1 \n 1. item2 |
This is an ordered list: \n 1. List item 1 \n 1. List item 2 前面的示例使用了 Markdown 中内置的自动编号。 This is an ordered list: \n 1. List item 1 \n 2. List item 2 前面的示例使用了显式编号。 |
无序列表 | \n * item1 \n * item2 或 \n - item1 \n - item2 |
This is an unordered list: \n * List item 1 \n * List item 2 |
嵌套列表 | \n * Parent1 \n\t * Child1 \n\t * Child2 \n * Parent2 \n * Parent1 \n\t 1. Child1 \n\t * Child2 \n 1. Parent2 可以将已排序列表和无序列表嵌套在一起。 制表符 \t 指示子元素的缩进级别。 |
This is an unordered list: \n * List item 1 \n\t * Child1 \n\t * Child2 \n * List item 2 This is an ordered nested list: \n 1. Parent1 \n\t 1. Child1 \n\t 1. Child2 \n 1. Parent2 |
- 自定义问答不会以任何方式处理图像。 由客户端应用程序负责呈现图像。
如果要使用更新/替换项目 API 添加内容,并且内容/文件包含 html 标记,则可以通过确保以编码格式转换标记的左侧和右侧部分来保留文件中的 HTML。
保留 HTML | 在 API 请求中的表示形式 | 在 KB 中的表示形式 |
---|---|---|
是 | <br> | <br> |
是 | <h3>header</h3> | <h3>header</h3> |
此外,CR LF(\r\n)
在 KB 中转换为 \n
。 LF(\n)
保持原样。 如果要对任何转义序列进行转义,如 \t 或 \n,可以使用反斜杠,例如:'\\r\\n' 和 '\\t'