我有一个表,需要将其包含在 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 将其呈现如下:
但是,一旦我将其推送到 TFS 2017,HTML 就根本不会呈现。尽管如此,Markdown 部分仍然可以正确呈现。
这是预期的行为吗?路线图上是否有任何支持 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。
关于azure-devops - Markdown 文件中的 HTML 不会被渲染,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47687090/