在 Markdown 文档中评估内联 ruby

发布于 2024-09-25 03:16:01 字数 79 浏览 2 评论 0原文

我需要从 Markdown 视图中调用一些助手。这是否是一种好的做法,并且通常受到流行的基于 ruby​​ 的 Markdown 解析器的支持?

I need to call some helpers from a Markdown view. Is this somehow a good practice and is generally supported on popular ruby-based Markdown parsers?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

彩扇题诗 2024-10-02 03:16:01

不,不是。 Markdown 是一种标准化的、以文本为中心的跨语言格式,大多数 Markdown 解析器都提供对标准语法的支持。

但是,需要高级功能的平台(例如 wiki 和 GitHub)会添加自定义功能。常见的功能是根据文档结构生成页面目录的标签。

AFAIK,BlueCloth 和 RDiscount 都不提供内置的扩展支持。在将 Markdown 文本传递给处理器之前,您必须自己对它们进行编码。

No, it isn't. Markdown is a standardized, text-focused, cross-language format and the most of Markdown parsers offers support for the standard syntax.

However, platforms that need advanced features, such as wiki and GitHub, adds custom features. Common features, are tags to generate page TOC based on the document structure.

AFAIK, not BlueCloth nor RDiscount offers built-in support for extensions. You would have to code them yourself before passing the markdown text to processor.

謌踐踏愛綪 2024-10-02 03:16:01

扩展类来处理新标签或语法并不是一个坏主意,但是从可能不受信任的来源评估内联 ruby​​ 代码绝对是一个可怕的主意!

Extending the class to handle new tags or syntax is not a bad idea, but eval'ing inline ruby code from a possibly untrusted source is an absolutely horrible idea!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文