双大括号导致Liquid Exception

在写上一篇博文的时候发现的问题.. 编译就一直报错,像这样

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Liquid Exception: Variable '{ {</span><span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">}' was not properly terminated with regexp: /\}\}/  in 2013-09-04-poj-1753.markdown
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/liquid-2.3.0/lib/liquid/block.rb:78:in `create_variable'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/liquid-2.3.0/lib/liquid/block.rb:38:in `parse'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/liquid-2.3.0/lib/liquid/document.rb:5:in `initialize'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/liquid-2.3.0/lib/liquid/template.rb:58:in `new'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/liquid-2.3.0/lib/liquid/template.rb:58:in `parse'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/liquid-2.3.0/lib/liquid/template.rb:46:in `parse'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/lib/jekyll/convertible.rb:79:in `do_layout'
/Users/txx/Desktop/workspace/txxblog/plugins/post_filters.rb:167:in `do_layout'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/lib/jekyll/post.rb:195:in `render'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/lib/jekyll/site.rb:200:in `block in render'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/lib/jekyll/site.rb:199:in `each'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/lib/jekyll/site.rb:199:in `render'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/lib/jekyll/site.rb:41:in `process'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/gems/jekyll-0.12.1/bin/jekyll:264:in `<top (required)>'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/bin/jekyll:19:in `load'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/bin/jekyll:19:in `<main>'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `eval'
/Users/txx/.rvm/gems/ruby-1.9.3-p392/bin/ruby_noexec_wrapper:14:in `<main>'
Build Failed

找了半天,也不知道怎么回事。

然后逐段屏蔽之后,发现是int DD的那句话导致的。

原因就是 双大括号连在一起了,无法解析。

国外网友说

1
2
3
This bug happens in other places. I use pandoc markdown, in latex math expressions, such as "${ {b} ^ {2} }$", then liquid throw this error.

I hack this by replace it with "{ {" ...

于是就只能这样咯,把所有的双括号连用中间加一个空格。

注意:为了保证本文能发出去,好多双大括号连用的地方 都被我加了空格

详情可以参考:https://github.com/imathis/octopress/issues/466

Comments