[Hiki-cvs 1459] [1006] * style/default/parser.rb, style/default/html_formatter.rb:

Back to archive index

svnno****@sourc***** svnno****@sourc*****
2009年 8月 24日 (月) 14:53:26 JST


Revision: 1006
          http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1006
Author:   fdiary
Date:     2009-08-24 14:53:26 +0900 (Mon, 24 Aug 2009)

Log Message:
-----------
	* style/default/parser.rb, style/default/html_formatter.rb:
	replacing WikiName links is now handled by HikiDoc by specifying
	use_wiki_name parameter.

Modified Paths:
--------------
    hiki/trunk/ChangeLog
    hiki/trunk/hiki/config.rb
    hiki/trunk/style/default/html_formatter.rb
    hiki/trunk/style/default/parser.rb

Modified: hiki/trunk/ChangeLog
===================================================================
--- hiki/trunk/ChangeLog	2009-08-23 15:02:43 UTC (rev 1005)
+++ hiki/trunk/ChangeLog	2009-08-24 05:53:26 UTC (rev 1006)
@@ -1,3 +1,8 @@
+2009-08-24  Kazuhiko  <kazuh****@fdiar*****>
+	* style/default/parser.rb, style/default/html_formatter.rb:
+	replacing WikiName links is now handled by HikiDoc by specifying
+	use_wiki_name parameter.
+
 2009-08-23  okkez  <okkez****@gmail*****>
 
 	* hiki/command.rb (Hiki::Command): use ERB::Util#h

Modified: hiki/trunk/hiki/config.rb
===================================================================
--- hiki/trunk/hiki/config.rb	2009-08-23 15:02:43 UTC (rev 1005)
+++ hiki/trunk/hiki/config.rb	2009-08-24 05:53:26 UTC (rev 1006)
@@ -5,7 +5,7 @@
 
 module Hiki
   VERSION = '0.9dev'
-  RELEASE_DATE = '2009-08-23'
+  RELEASE_DATE = '2009-08-24'
 end
 
 # For backward compatibility

Modified: hiki/trunk/style/default/html_formatter.rb
===================================================================
--- hiki/trunk/style/default/html_formatter.rb	2009-08-23 15:02:43 UTC (rev 1005)
+++ hiki/trunk/style/default/html_formatter.rb	2009-08-24 05:53:26 UTC (rev 1006)
@@ -25,7 +25,6 @@
     def to_s
       s = @html
       s = replace_inline_image( s )
-      s = replace_wikiname( s ) if****@conf*****_wikiname
       s = replace_link( s )
       s = replace_auto_link( s ) if****@conf*****_link
       s = replace_heading( s )
@@ -82,16 +81,6 @@
       end
     end
 
-    WIKINAME_RE   = /(\b(?:[A-Z][a-z0-9]+){2,}[A-Z]*\b)/
-
-    def replace_wikiname( text )
-      replace_inline( text ) do |str|
-        str.gsub!( WIKINAME_RE ) do |i|
-          %Q|<a href="#{i}">#{i}</a>|
-        end
-      end
-    end
-
     PLUGIN_OPEN_RE = /<(span|div) class="plugin">/
     PLUGIN_CLOSE_RE = %r!</(span|div)>!
     LINK_OPEN_RE = /<a .*href=/

Modified: hiki/trunk/style/default/parser.rb
===================================================================
--- hiki/trunk/style/default/parser.rb	2009-08-23 15:02:43 UTC (rev 1005)
+++ hiki/trunk/style/default/parser.rb	2009-08-24 05:53:26 UTC (rev 1006)
@@ -21,10 +21,12 @@
     end
     
     def initialize( conf )
+      @use_wiki_name = conf.use_wikiname
     end
 
     def parse( s, top_level = 2 )
-      HikiDoc.to_html( s, :level => top_level )
+      HikiDoc.to_html( s, :level => top_level,
+                       :use_wiki_name => @use_wiki_name )
     end
   end
 end




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