新手问题 Jekyll 中使用 redcarpet,单词中间的_被滤掉的问题

zhufengxiangxyz · 2015年08月12日 · 最后由 zhufengxiangxyz 回复于 2015年08月12日 · 1852 次阅读
应该是这个样子的
class Person < ActiveRecord::Base
  validates :terms_of_service, acceptance: true
end
但是效果是这样的

注意看 terms_of_service 这个词。

请问有什么办法解决吗。

这么写:

terms\_of\_service

或者设置选项

redcarpet:
  extensions: [:no_intra_emphasis]

#1 楼 @luikore 谢谢,问题解决了,顺带把代码格式错乱的问题也一并解决了。下面的扩展是是什么意思。

#2 楼 @zhufengxiangxyz

:no_intra_emphasis: do not parse emphasis inside of words. Strings such as foo_bar_baz will not generate <em> tags.

参见:https://github.com/vmg/redcarpet#and-its-like-really-simple-to-use

#3 楼 @yellowstar 谢谢,这个页面先前我看了下,以为是 API 方面的。😓

需要 登录 后方可回复, 如果你还没有账号请 注册新账号