Index: lib/hikidoc.rb =================================================================== --- lib/hikidoc.rb (リビジョン 4222) +++ lib/hikidoc.rb (リビジョン 4272) @@ -340,12 +340,29 @@ BLOCKQUOTE_RE = /\A""[ \t]?/ def compile_blockquote(f) - @output.blockquote_open lines = [] f.while_match(BLOCKQUOTE_RE) do |line| lines.push line.sub(BLOCKQUOTE_RE, "") skip_comments f end + + # 2008-07-19 ds14050 + # test if the first line is [[title|cite]] or [[cite]] or [[title|]]. + cite, title = nil, nil + m = inline_syntax_re.match(lines.first) + if m and m[1] and m.pre_match.strip.empty? and m.post_match.strip.empty? + link = m[1][2...-2] + if m = /\A(?>[^|\\]+|\\.)*\|/.match(link) + cite, title = fix_uri(m.post_match), m[0].chop + else + cite, title = fix_uri(link), nil + end + cite = nil if cite and cite.empty? + title = nil if title and title.empty? + lines.shift + end + + @output.blockquote_open cite, title compile_blocks lines.join("") @output.blockquote_close end @@ -677,8 +694,10 @@ end private :tdattr - def blockquote_open - @f.print "
" + def blockquote_open(cite=nil, title=nil) + cite = %Q( cite="#{escape_html_param cite}") if cite + title = %Q( title="#{escape_html_param title}") if title + @f.print "" end def blockquote_close