--- posttdiary-ex-1.66.rb	2007-11-22 01:19:32.000000000 +0900
+++ posttdiary-ex.rb	2008-07-30 16:55:22.000000000 +0900
@@ -691,6 +691,7 @@
 	image_format_with_thumbnail = ' <A HREF="$1"><img class="$3" src="$2" alt="$4" title="$4"></a>'
 	image_format_specified = nil
 	wiki_style = false
+	rd_style = false
 	blog_style = false
 	use_original_name = false
 	date_margin = 7
@@ -726,6 +727,7 @@
 		['--image-format', '-f', GetoptLong::REQUIRED_ARGUMENT],
 		['--use-original-name', '-r', GetoptLong::NO_ARGUMENT],
 		['--wiki-style', '-w', GetoptLong::NO_ARGUMENT],
+		['--rd-style', '-2', GetoptLong::NO_ARGUMENT],
 		['--blog-style', '-B', GetoptLong::NO_ARGUMENT],
 		['--read-exif', '-c', GetoptLong::NO_ARGUMENT],
 		['--margin-time', '-m', GetoptLong::REQUIRED_ARGUMENT],
@@ -795,6 +797,9 @@
 			when '--wiki-style'
 				wiki_style = true
 				use_image_ex = true
+			when '--rd-style'
+				rd_style = true
+				use_image_ex = true
 			when '--blog-style'
 				blog_style = true
 			when '--read-exif'
@@ -812,6 +817,8 @@
 				rotation_degree_specified = 0
 				rotation_degree_specified = 90 if arg =~ /right/i
 				rotation_degree_specified = -90 if arg =~ /left/i
+                        when '--class-name'
+                                class_name = arg
 			end
 		end
 	rescue
@@ -868,6 +875,11 @@
 			image_format = '{{image $0,\'$4\'}}'
 			image_format_with_thumbnail = image_format
 		end
+		if rd_style then
+			image_format = '((% image_right $0,\'$4\' %))'
+                              image_format_with_thumbnail.gsub!(/^ /, '')
+                        image_format_with_thumbnail = "((:#{image_format_with_thumbnail}:))"
+		end
 	end
 	if wiki_style then
 		add_div_imgnum = 0
@@ -1053,6 +1065,9 @@
 					next
 				end
 			end
+			if rd_style then
+                                @body.gsub!(/<%=.*%>/, "")
+			end
 			img_in_div+=1
 			if thumbnail_size and thumbnail_name[i].size > 0 then
 				t = thumbnail_name[i]
@@ -1069,7 +1084,7 @@
 				img_src = "<div class=\"photos\">" + img_src + "</div>"
 			end
 		end
-		img_src.sub!( /^/ , ' ' ) if ! wiki_style
+		img_src.sub!( /^/ , ' ' )  if (! wiki_style) and (! rd_style) 
 		if use_subject then
 			img_src = img_src + "\n" if !(img_src =~ /^\s*$/)
 			@body = "#{img_src}#{@body.sub( /\n+\z/, '' )}"
@@ -1082,6 +1097,7 @@
 		title = ''
 		@body = "#{subject}\n#{@body}"
 		@body = "!" + @body if wiki_style
+		@body = "= " + @body if rd_style
 	else
 		title = subject
 	end

