svnno****@sourc*****
svnno****@sourc*****
2009年 8月 25日 (火) 00:33:07 JST
Revision: 1007 http://sourceforge.jp/projects/hiki/svn/view?view=rev&revision=1007 Author: okkez Date: 2009-08-25 00:33:07 +0900 (Tue, 25 Aug 2009) Log Message: ----------- merge from trunk r1005:1006 * 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/branches/rack/ChangeLog hiki/branches/rack/hiki/config.rb hiki/branches/rack/style/default/html_formatter.rb hiki/branches/rack/style/default/parser.rb Modified: hiki/branches/rack/ChangeLog =================================================================== --- hiki/branches/rack/ChangeLog 2009-08-24 05:53:26 UTC (rev 1006) +++ hiki/branches/rack/ChangeLog 2009-08-24 15:33:07 UTC (rev 1007) @@ -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/branches/rack/hiki/config.rb =================================================================== --- hiki/branches/rack/hiki/config.rb 2009-08-24 05:53:26 UTC (rev 1006) +++ hiki/branches/rack/hiki/config.rb 2009-08-24 15:33:07 UTC (rev 1007) @@ -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/branches/rack/style/default/html_formatter.rb =================================================================== --- hiki/branches/rack/style/default/html_formatter.rb 2009-08-24 05:53:26 UTC (rev 1006) +++ hiki/branches/rack/style/default/html_formatter.rb 2009-08-24 15:33:07 UTC (rev 1007) @@ -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/branches/rack/style/default/parser.rb =================================================================== --- hiki/branches/rack/style/default/parser.rb 2009-08-24 05:53:26 UTC (rev 1006) +++ hiki/branches/rack/style/default/parser.rb 2009-08-24 15:33:07 UTC (rev 1007) @@ -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