[Hiki-users 222] Re: Hiki文法についていくつか質問

Back to archive index

KADO Masanori kdmsn****@gmail*****
2011年 4月 24日 (日) 23:05:30 JST


2011年4月24日20:11 Makoto Kuwata <kwa****@kuwat*****>:
> URL末尾に ? をつけるのはあくまで回避策であり、*本来であれば* Hiki自身が
> 画像へのリンクを張る記法なりプラグインを用意したほうがいいのでは
> ないかと思います。

Hikidocではオプションで使い分けできるみたいですので、
Hikiでデフォルト記法を使うのであれば、以下の修正をしてから、
hikidoc.rbに @allow_bracket_inline_image = false を設定する感じでいけそうです。

# 標準に入れるには Githubに pull request すればいいんですかねえ……。

diff --git a/style/default/html_formatter.rb b/style/default/html_formatter.rb
index 3547da6..f6c0819 100644
--- a/style/default/html_formatter.rb
+++ b/style/default/html_formatter.rb
@@ -26,7 +26,7 @@ module Hiki

     def to_s
       s = @html
-      s = replace_inline_image( s )
+#      s = replace_inline_image( s )
       s = replace_link( s )
       s = replace_auto_link( s ) if****@conf*****_link
       s = replace_heading( s )
diff --git a/style/default/parser.rb b/style/default/parser.rb
index e8136fb..6c291d7 100644
--- a/style/default/parser.rb
+++ b/style/default/parser.rb
@@ -22,11 +22,15 @@ module Hiki

     def initialize( conf )
       @use_wiki_name = conf.use_wikiname
+      @allow_bracket_inline_image = conf.allow_bracket_inline_image
     end

     def parse( s, top_level = 2 )
-      HikiDoc.to_html( s, :level => top_level,
-                       :use_wiki_name => @use_wiki_name )
+      options = {:level => top_level, :use_wiki_name => @use_wiki_name}
+      unless @allow_bracket_inline_image.nil?
+        options[:allow_bracket_inline_image] = @allow_bracket_inline_image
+      end
+      HikiDoc.to_html( s, options )
     end
   end
 end

-- 
kdmsnr - KADO, Masanori




Hiki-users メーリングリストの案内
Back to archive index