简体   繁体   English

Markdown 表内注释

[英]Markdown comment within table

I am looking for a way to add comments specific to different rows in a Markdown table (parsed by Slate ).我正在寻找一种在 Markdown 表(由Slate解析)中添加特定于不同行的注释的方法。 I don't want them to appear in the HTML generated from this Markdown file.我不希望它们出现在从此 Markdown 文件生成的 HTML 中。

I haven't found any comment syntax which works in this setting.我还没有找到任何适用于此设置的注释语法。 I tried我试过了

[]: # (comment)
[]: # "comment"
[]: # 'comment'
[//]: # (comment)
[comment]: # (comment)
<!-- comment -->

and variations of them, could not get anything to work.以及它们的变体,无法正常工作。

Have any of you already succeeded to do so?你们中有人已经成功了吗?

The solution I found was to add an extra column to the table on the relevant rows, eg我找到的解决方案是在相关行的表中添加一个额外的列,例如

Name | Description 
--------- | ------- 
first item | description | comment
second item | description

With this the comment never appeared in the generated HTML.有了这个,评论就永远不会出现在生成的 HTML 中。 I don't know if it is good practice and how portable it is though.我不知道这是否是好的做法以及它的便携性。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM