azure-devops - Markdown 文件中的 HTML 不会被渲染

标签 azure-devops

我有一个表,需要将其包含在 TFS 2017 本地存储库的 Markdown 文档中。该表需要包含多个值,其中一列中用换行符分隔。我可以编写它并在 Visual Studio Code 中使用 HTML 标记查看预期结果,但是,TFS 2017 无法正确呈现它。

Top of the **markdown** file

<table>
    <tr>
        <th>Key</th>
        <th>Description</th>
        <th>Value</th>
        <th>Example</th>
        <th>Required</th>
    </tr>
    <tr>
        <td>app-name</td>
        <td>The name of the application that the resource was provisioned for.</td>
        <td>The app name is a simplified version of the project-name tag below, if the resource was created for a project. Otherwise, use the product name.</td>
        <td>foo-bar<br/>product-evaluation</td>
        <td>If associated to an app, yes.</td>
    </tr>
</table>

Bottom of the *markdown* file.

以上面的 markdown 文件为例,Visual Studio 将其呈现如下:

VS Code

但是,一旦我将其推送到 TFS 2017,HTML 就根本不会呈现。尽管如此,Markdown 部分仍然可以正确呈现。

TFS 2017

这是预期的行为吗?路线图上是否有任何支持 Markdown 文件中的 HTML 的内容? Markdown 规范支持这一点。如果不支持 HTML,我该如何在标准 MD 表列中使用换行符?

最佳答案

是的,这是预期的行为。

目前,本地 TFS 不支持它。但是在VSTS(TFS上线)中可以预览渲染,但在仪表板中仍然无法渲染(添加到仪表板)。

我们目前没有支持此功能的公开时间表。不过 VSTS 已经支持预览版,所以也许很快就会全面支持。您可以在此处跟踪功能时间表:https://www.visualstudio.com/en-us/news/release-archive-vso ,这是第一个更新的地方。

在您的场景中,您可以使用 Markdown 来呈现表格而不是 html:

您可以通过组合单词列表​​并用连字符 -(第一行)分隔它们来创建表格,然后用竖线 | 分隔每一列:

| Key | Description | Value |  Example |Required |
|-----------|:-----------:|-----------:|-----------:|-----------:|
| app-name  | The name of the application that the resource was provisioned for. |The app name is a simplified version of the project-name tag below, if the resource was created for a project. Otherwise, use the product name. | foo-bar product-evaluation | If associated to an app, yes.|

参见Syntax guidance for Markdown files了解详情。

此外,Wiki TFS 2018 中引入的功能,它支持 Markdown 中的 HTML 标签。如果可以的话,您可以升级到 TFS 2018。

enter image description here

关于azure-devops - Markdown 文件中的 HTML 不会被渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47687090/

相关文章:

continuous-integration - VSTS 发布管道找不到已发布的工件

azure - 如何使用较新版本的 Maven 在 Azure Pipelines 中进行 CI/CD 构建

azure - 使用 Azure DevOps 将文件复制到不同订阅中的 Azure Blob 存储

nuget - 在 Azure Devops 上运行构建时找不到 Assets 文件 project.assets.json

tfs - 为什么我的 VSTS 自定义任务通过退出代码 1?

.net-core - AzureDevOps - 无法作为单个文件发布

tfs - 未找到 Azure DevOps Server 2019/2020 访问级别页面

azure-devops - 用于管理多个项目的 VSTS 看板

Azure Artifacts Feed 比 Maven Central 慢得多

azure - 无法解析远程名称 : 'dev.azure.com' when setting up self-hosted devops agent in Docker