2013-10-30 20 views
1

我已經安裝了html美化程序gem。當我美化一些文件時,會拋出以下錯誤。不是所有的文件。Html美化器會引發以下「線條太大」錯誤

$ htmlbeautifier abc.html.erb

/home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:9:in `rescue in beautify': Error parsing abc.html.erb: Outdented too far on line 163 (RuntimeError) 
from /home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:6:in `beautify' 
from /home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:17:in `block (2 levels) in <top (required)>' 
from /home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:16:in `open' 
from /home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:16:in `block in <top (required)>' 
from /home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:13:in `each' 
from /home/x/.rvm/gems/[email protected]/gems/htmlbeautifier-0.0.8/bin/htmlbeautifier:13:in `<top (required)>' 
from /home/x/.rvm/gems/[email protected]/bin/htmlbeautifier:23:in `load' 
from /home/x/.rvm/gems/[email protected]/bin/htmlbeautifier:23:in `<main>' 
from /home/x/.rvm/gems/[email protected]/bin/ruby_noexec_wrapper:14:in `eval' 
from /home/x/.rvm/gems/[email protected]/bin/ruby_noexec_wrapper:14:in `<main>' 

這裏是我的紅寶石

$ whereis紅寶石

ruby: /usr/bin/ruby /usr/bin/ruby1.8 /usr/lib/ruby /usr/bin/X11/ruby /usr/bin/X11/ruby1.8 /usr/share/man/man1/ruby.1.gz 

什麼錯誤?如何解決?

回答

1

htmlbeautifier的源代碼建議您在文件中關閉end關鍵字或}關閉大括號。

如果你附上了你的一個html文件,它會有更多的幫助。

+0

你的正確。美化最大的文件我是不可戰勝的。我沒有權限顯示我的密碼。對不起朋友。不能我執行它? – Sam

+0

我不明白你的意思是通過實施它? 雖然您可以通過此文件共享一些鏈接到某個plunker,jsbin或其他鏈接。 – Merstzik

+0

Sry。我的意思是我不能用htmlbeautifier做? – Sam