如何在降价促销中避免反引号? [英] How does one escape backticks in markdown?
问题描述
我正在markdown
中编写一些文档,并且我想记录一下如何使用bash HEREDOC创建文本文件.这是我要记录的命令:
I am writing some documentation in markdown
and I want to document how to create a text file using a bash HEREDOC. Here is the command I want to document:
# cat > /tmp/answers.txt <<EOT
> value1=blah
> value2=something else
> value3=`hostname`
> value4=onetwothree
EOT
在markdown中,我尝试使用`将文本呈现为代码".
In markdown one uses the ` to render the text as "code" I have tried doing this ...
`# cat > /tmp/answers.txt <<EOT`
`> value1=blah`
`> value2=something else`
`> value3=\`hostname\``
`> value4=onetwothree`
`EOT`
...但是会导致看起来像这样...
... but that results in something that looks like this ...
# cat > /tmp/answers.txt <<EOT
> value1=blah
> value2=something else
> value3=\
主机名
> value4 =一个二三
EOT
hostname
> value4=onetwothree
EOT
推荐答案
下面的代码块可以解决问题.
This code block below does the trick.
```
# cat > /tmp/answers.txt <<EOT
> value1=blah
> value2=something else
> value3=`hostname`
> value4=onetwothree
EOT
```
三个Backtick表示它是代码段,并且该代码段必须以另外三个Backtick结尾.
The three Backtick means it's snippet of code and a snippet must end with three more Backtick.
有关Markdown的更多帮助,请参阅此 CheatSheet.
For more help with Markdown refer this CheatSheet.
这篇关于如何在降价促销中避免反引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!