gpt4 book ai didi

markdown - 为什么 Markdown 需要转义\。显示斜线点

转载 作者:行者123 更新时间:2023-12-02 03:50:01 25 4
gpt4 key购买 nike

为什么 markdown 需要在 \.path 之前转义\才能正确呈现此 name\of\.path。如果没有转义,它会呈现 name\of.path

即它必须编码为 name\of\\.path 才能得到 name\of\.path

最佳答案

Markdown uses backslash as an escape character :

Markdown allows you to use backslash escapes to generate literal characters which would otherwise have special meaning in Markdown’s formatting syntax. For example, if you wanted to surround a word with literal asterisks (instead of an HTML <em> tag), you can use backslashes before the asterisks, like this:

\*literal asterisks\*

Markdown provides backslash escapes for the following characters:

\   backslash
` backtick
* asterisk
_ underscore
{} curly braces
[] square brackets
() parentheses
# hash mark
+ plus sign
- minus sign (hyphen)
. dot
! exclamation mark

请注意,句点(“点”)包含在此列表中。因此,句点前的单个反斜杠简单地转义了句点。要转义反斜杠本身(并因此按字面显示),必须用第二个反斜杠转义。

关于markdown - 为什么 Markdown 需要转义\。显示斜线点,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/45764479/

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