github - HTML 代码放入 Github 上的 README.md 中

标签 github markdown

我尝试将一些 HTML 片段放入 Github 上的 README.md 中,但 HTML 代码已被解析。

我该怎么做?

<h2>Example of code</h2>

<pre>
    <div class="container">
        <div class="block two first">
            <h2>Your title</h2>
            <div class="wrap">
                //Your content
            </div>
        </div>
    </div>
</pre>

最佳答案

尝试将 HTML 代码片段放入 ```HTML block 中,如下所示:

```html
<h2>Example of code</h2>

<pre>
    <div class="container">
        <div class="block two first">
            <h2>Your title</h2>
            <div class="wrap">
            //Your content
            </div>
        </div>
    </div>
</pre>
```

关于github - HTML 代码放入 Github 上的 README.md 中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16350545/

相关文章:

python - Github API 帖子未找到 404

github - 如何在 GitHub 中设置文件权限

python - IPython `display` 到字符串

github - 在 Github 的表格中使用 Markdown 图标?

python - 在 Python 中将文本转换为 HTML 注释

github - 显示 github 自述文件中的图像

git - 如何更新 fork 以发出干净的 pull 请求?

windows - 将多个存储库克隆到公共(public)父文件夹结构中

javascript - 使用 GitHub API 检查 repo 是否已加星标

javascript - 当我使用 markdown 时,我的第一个元素的格式与其他元素不同