tDiary.org[tDiary-devel] my-ex.rb拡張(was Re: html_anchor2.rb?)

< Prev [Date] Next > < Prev [Thread] Next > Index by date Index by thread
smbdです

myの引数に.html形式が許されるようになりましたが
もう1段階推し進めて
ブラウザのアドレス覧などからそのままコピー&ペーストできるように
以下のpatchを取り込んでもらえないでしょうか?

Index: my-ex.rb
===================================================================
RCS file: /cvsroot/tdiary/plugin/my-ex.rb,v
retrieving revision 1.6
diff -u -r1.6 my-ex.rb
--- my-ex.rb    16 Dec 2003 08:28:52 -0000      1.6
+++ my-ex.rb    18 Dec 2003 06:15:14 -0000
@@ -11,7 +11,11 @@
 # Distributed under the GPL

 def my( a, str, title = nil )
-       date, noise, frag = a.scan( /^(\d{8}|\d{6}|\d{4})([^\dcp]*)?([cpt]\d\d)?/ )[0]
+       if a =~ /^#{@conf.base_url}(.*)/ then
+          a = a.scan( /^#{@conf.base_url}(.*)/ )[0].to_s
+       end
+
+       date, noise, frag = a.scan(/^(\d{8}|\d{6}|\d{4})([^\dcp]*)?([cpt]\d\d)?/ )[0]
        anc = frag ? "#{date}#{frag}" : date
        place, frag = frag.scan( /([cpt])(\d\d)/ )[0] if frag
        if date and frag and @diaries[date] then

それでは。

-- 
1024D/F6AC9AF9 2002-06-25 Mitsuru Shimamura (smbd) <mitsuru@diana.dti.ne.jp>
Fingerprint = B14F C51C FA61 3F7E 4D22 35DF 1384 2E7B F6AC 9AF9
http://smbd.homelinux.org/diary/
-- 



-------------------------------------------------------
This SF.net email is sponsored by: IBM Linux Tutorials.
Become an expert in LINUX or just sharpen your skills.  Sign up for IBM's
Free Linux Tutorials.  Learn everything from the bash shell to sys admin.
Click now! http://ads.osdn.com/?ad_id=1278&alloc_id=3371&op=click
_______________________________________________
tDiary-devel mailing list
tDiary-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tdiary-devel