[DRE-commits] [ruby-org] 114/303: Added support for angle links

Jérémy Bobbio lunar at alioth.debian.org
Fri Aug 9 17:33:39 UTC 2013


This is an automated email from the git hooks/post-receive script.

lunar pushed a commit to branch master
in repository ruby-org.

commit 48e7bd97423f2501dc2d44e096d91ab5677e5c29
Author: Waldemar Quevedo <waldemar.quevedo at gmail.com>
Date:   Sun Sep 18 01:14:59 2011 +0200

    Added support for angle links
---
 lib/org-ruby/regexp_helper.rb |   13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/org-ruby/regexp_helper.rb b/lib/org-ruby/regexp_helper.rb
index 7378009..801cff0 100644
--- a/lib/org-ruby/regexp_helper.rb
+++ b/lib/org-ruby/regexp_helper.rb
@@ -144,11 +144,17 @@ module Orgmode
       i = str.gsub(@org_link_regexp) do |match|
         yield $1, nil
       end
-      i.gsub(@org_link_text_regexp) do |match|
-        yield $1, $2
+      if str =~ @org_angle_link_text_regexp
+        i.gsub(@org_angle_link_text_regexp) do |match|
+          yield "#{$2}:#{$3}", nil
+        end
+      else
+        i.gsub(@org_link_text_regexp) do |match|
+          yield $1, $2
+        end
       end
     end
-    
+
     # Rewrites all of the inline image tags.
     def rewrite_images(str) #  :yields: image_link
       str.gsub(@org_img_regexp) do |match|
@@ -180,6 +186,7 @@ module Orgmode
                                \]\[
                                  ([^\]]*) # This is the friendly text
                                \]\]/x
+      @org_angle_link_text_regexp = /(<|<)(\w+):([^\]\t\n\r<> ][^\]\t\n\r<> ]*)(>|>)/x
     end
   end                           # class Emphasis
 end                             # module Orgmode

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-ruby-extras/ruby-org.git



More information about the Pkg-ruby-extras-commits mailing list