[DRE-commits] [ruby-org] 101/303: Allow pretty text in links to be images.
Jérémy Bobbio
lunar at alioth.debian.org
Fri Aug 9 17:33:36 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 4e146aa3facd6f9473afb1e11da5942903b0219c
Author: Puneeth Chaganti <punchagan at gmail.com>
Date: Mon Aug 15 20:41:51 2011 +0530
Allow pretty text in links to be images.
---
lib/org-ruby/html_output_buffer.rb | 3 +++
1 file changed, 3 insertions(+)
diff --git a/lib/org-ruby/html_output_buffer.rb b/lib/org-ruby/html_output_buffer.rb
index 9d094ff..e95ea09 100644
--- a/lib/org-ruby/html_output_buffer.rb
+++ b/lib/org-ruby/html_output_buffer.rb
@@ -158,6 +158,9 @@ module Orgmode
end
link = link.sub(/^file:/i, "") # will default to HTTP
link = link.sub(/\.org$/i, ".html")
+ text = text.gsub(/([^\]]*\.(jpg|jpeg|gif|png))/xi) do |link|
+ "<img src=\"#{link}\" />"
+ end
"<a href=\"#{link}\">#{text}</a>"
end
if (@output_type == :table_row) then
--
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