如何在 Markdown 注释一段文字

写代码你可以注释,不需要处理的代码就 comment out。
写 Markdown 呢?一篇文章写出来,总是有点草稿的,每次都忍痛割爱删掉,可能下次还要再敲一遍。
所以我一般都写到某个特定的 class 的 div 里,再用 CSS 把它们隐藏。

可惜这种方法既不优雅也不通用。
机智如我如果一下就 bing 到了:syntax - Comments in Markdown - Stack Overflow

你可以用下面这些:

[comment]: <> (This is a comment, it will not be included)
[comment]: <> (in  the output file unless you use it in)
[comment]: <> (a reference style link.)
[//]: <> (This is also a comment.)
[//]: # (This may be the most platform independent comment)

我决定以后用:

[^_^]:
    commentted-out contents
    should be shift to right by four spaces (`>>`).

亲测可用(Pandoc、GitHub、简书、作业部落)。十分完美,除了这个 warning:

pandoc: Duplicate note reference `^' "source" (line 85, column 1)

如果你想测试一下你的 Markdown 能不能这么用,这是一点测试的文字:

a

[^_^]:
    b

c

d

显示的 a c d 应当间隔一样长。如下:

a

c

d


@delogn 的评论:

[^_^]:
    1

[>_<]:
    2

[>_>]:
    3

都可以用啊,不错不错!以后吐槽和心情都可以写在注释里了!

赞赞赞!

最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
【社区内容提示】社区部分内容疑似由AI辅助生成,浏览时请结合常识与多方信息审慎甄别。
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

相关阅读更多精彩内容

友情链接更多精彩内容