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

zhufengxiangxyz · August 12, 2015 · Last by zhufengxiangxyz replied at August 12, 2015 · 1852 hits
应该是这个样子的
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 方面的。😓

You need to Sign in before reply, if you don't have an account, please Sign up first.