有没有一种方法可以从Markdown文章中获取内容并制作一个代码段(例如,搜索结果中显示的内容)?
如果你写了这样的文章:
#Welcome!
This is a *large* amount of markdown _symbols_.
Here are some other things that are possible in markdown:
* Lists
* using
* an asterisk
只输出非格式化的markdown,你的代码片段中会出现很多哈希值和不需要的内容。看起来很糟糕。
> #Welcome! This is a *large* amount of markdown _symbols_ Here are some other things that are possible in markdown: * Lists * using
> * an asterisk
有没有一种常见的做法来处理这个问题?
答案 0 :(得分:0)
pandoc转换为多个outputformats。
格式'plain'剥离强和em,但留下像标题和列表一样的块。可以接受吗?
$ pandoc --to plain Welcome.md
Welcome!
========
This is a large amount of markdown symbols. Here are some other things
that are possible in markdown:
- Lists
- using
- an asterisk
不支持'plain'