Forum: Ruby tagz-5.0.0

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
324ce80d9dbe9417607192038fb880bf?d=identicon&s=25 Andrew S. Townley (Guest)
on 2009-03-27 14:24
(Received via mailing list)
Hi Ara,

Here's a fix for the empty tag problem.  With this fix, I now have a
usable solution.  It would still be nice to support combining multiple
hash arguments automatically, but that's not a showstopper.

Thanks again for all your hard work.

Cheers,

ast

excalibur$ diff -u /var/lib/gems/1.8/gems/tagz-5.0.0/lib/tagz.rb
/tmp/tagz.rb
--- /var/lib/gems/1.8/gems/tagz-5.0.0/lib/tagz.rb  2009-03-24
11:58:05.000000000 +0000
+++ /tmp/tagz.rb  2009-03-27 13:21:47.000000000 +0000
@@ -37,6 +37,7 @@
       end

       tagz.concat "<#{ name }#{ attributes }>"
+      startsz = tagz.size

       if content.empty?
         if block
@@ -59,6 +60,7 @@
         tagz.concat "</#{ name }>"
       end

+      tagz[-1] = "/>" if tagz.size == startsz
       tagz
     end
This topic is locked and can not be replied to.