Markdown 中居中的一行 python 代码

Centered one-line python code in markdown

我正在尝试将 markdown 中的代码居中(在 JupyterLab 中使用)。这是我使用的代码

<div style="text-align:center"><span style="font-size:1em;"> 
`code template`
</span> </div>

但是这段代码在这个简单片段的开头和结尾一直显示 `。任何解决此问题的建议表示赞赏

Markdown generally is not processed in HTML block-level elements like <div>s:

Note that Markdown formatting syntax is not processed within block-level HTML tags. E.g., you can’t use Markdown-style *emphasis* inside an HTML block.

但您仍然可以使用 HTML:

<div style="text-align:center"><span style="font-size:1em;"> 
    <code>code template</code>
</span> </div>