【发布时间】:2019-08-07 22:50:40
【问题描述】:
如何将丰富的 Markdown 转换为纯文本? 所以它可以用于 Facebook OpenGraph 描述。
我正在使用 MarkdownSharp,它似乎没有这个功能。 在我重新发明轮子之前,我想先在这里问一下。
非常感谢任何有关实施策略的提示!
示例
The Monorailcat
---------------

One of the earliest pictures of **monorail cat** found is from the website [catmas.com’s blog][1] section, dated from November 2, 2006.
[1]: http://catmas.com/blog
应转换为:
The Monorailcat
One of the earliest pictures of monorail cat found is from the website catmas.com’s blog section, dated from November 2, 2006.
【问题讨论】:
-
您需要自己实现吗?必须有几个转换器可用,最坏的情况是 markdown-to-html 和 html-to-text。
-
我宁愿不@MiserableVariable :) 我也考虑过两步方法,但这听起来有很多开销 - 特别是因为我想为每个浏览量生成结果,而不是缓存它(还)在数据库中。
-
您是否在寻找任何直接转换器?我确信它们存在,尽管我没有检查过自己。
-
我尝试寻找它们,但在 C# 中没有找到它们。
-
alt 文本不应该在纯文本输出中吗?
标签: c# markdown markdownsharp