Skip to content

Commit

Permalink
* tdiary/wiki_style.rb (to_html): support multi-line plugins.
Browse files Browse the repository at this point in the history
git-svn-id: https://tdiary.svn.sourceforge.net/svnroot/tdiary/trunk/core@2474 7f22e88f-374d-0410-998f-c91420d97ba2
  • Loading branch information
kazuhiko committed Oct 15, 2005
1 parent 9acc54e commit 059d62e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
3 changes: 3 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
2005-10-15 Kazuhiko <kazuhiko@fdiary.net>
* tdiary/wiki_style.rb (to_html): support multi-line plugins.

2005-10-12 TADA Tadashi <sho@spc.gr.jp>
* tdiary.rb, *_style.rb, theme/base.css: add section_enter/leave_proc.

Expand Down
4 changes: 2 additions & 2 deletions tdiary.rb
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
=begin
== NAME
tDiary: the "tsukkomi-able" web diary system.
tdiary.rb $Revision: 1.254 $
tdiary.rb $Revision: 1.255 $
Copyright (C) 2001-2005, TADA Tadashi <sho@spc.gr.jp>
You can redistribute it and/or modify it under GPL2.
=end

TDIARY_VERSION = '2.1.3.20051012'
TDIARY_VERSION = '2.1.3.20051015'

require 'cgi'
require 'uri'
Expand Down
6 changes: 3 additions & 3 deletions tdiary/wiki_style.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#
# Wiki_style.rb: Wiki style for tDiary 2.x format. $Revision: 1.14 $
# Wiki_style.rb: Wiki style for tDiary 2.x format. $Revision: 1.15 $
#
# if you want to use this style, add @style into tdiary.conf below:
#
Expand Down Expand Up @@ -109,10 +109,10 @@ def to_s
private
def to_html( string )
html = HikiDoc::new( string, :level => 3, :empty_element_suffix => '>' ).to_html.strip
html.gsub!( %r!<span class="plugin">\{\{(.+?)\}\}</span>! ) do
html.gsub!( %r!<span class="plugin">\{\{(.+?)\}\}</span>!m ) do
"<%=#{CGI.unescapeHTML($1)}%>"
end
html.gsub!( %r!<div class="plugin">\{\{(.+?)\}\}</div>! ) do
html.gsub!( %r!<div class="plugin">\{\{(.+?)\}\}</div>!m ) do
"<p><%=#{CGI.unescapeHTML($1)}%></p>"
end
html.gsub!( %r!<a href="(.+?)">(.+?)</a>! ) do
Expand Down

0 comments on commit 059d62e

Please sign in to comment.