Allow link: in Tidylinks
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@5582 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
d52c3b1e94
commit
6dbf1140a4
@ -1,3 +1,8 @@
|
|||||||
|
Thu Jan 29 22:41:53 2004 Dave Thomas <dave@pragprog.com>
|
||||||
|
|
||||||
|
* lib/rdoc/generators/html_generator.rb: Allow 'link:' in Tidylinks.
|
||||||
|
THis means you can write "see f1[link:files/f1_rb.html]".
|
||||||
|
|
||||||
Thu Jan 29 22:24:47 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
|
Thu Jan 29 22:24:47 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
|
||||||
|
|
||||||
* sample/openssl/gen_csr.rb: follow OpenSSL::X509::Name change.
|
* sample/openssl/gen_csr.rb: follow OpenSSL::X509::Name change.
|
||||||
@ -23,6 +28,7 @@ Thu Jan 29 17:03:49 2004 Yukihiro Matsumoto <matz@ruby-lang.org>
|
|||||||
* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
|
* dir.c: merge tuning from H.Yamamoto <ocean@m2.ccsnet.ne.jp>.
|
||||||
[ruby-dev:22761]
|
[ruby-dev:22761]
|
||||||
|
|
||||||
|
>>>>>>> 1.2844
|
||||||
Thu Jan 29 11:32:14 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
|
Thu Jan 29 11:32:14 2004 NAKAMURA, Hiroshi <nakahiro@sarion.co.jp>
|
||||||
|
|
||||||
* test/rss/test_*: do $: trick while searching a module in the current
|
* test/rss/test_*: do $: trick while searching a module in the current
|
||||||
|
@ -125,15 +125,10 @@ module Generators
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
# And we're invoked with a potential external hyperlink mailto:
|
|
||||||
# just gets inserted. http: links are checked to see if they
|
|
||||||
# reference an image. If so, that image gets inserted using an
|
|
||||||
# <img> tag. Otherwise a conventional <a href> is used. We also
|
|
||||||
# support a special type of hyperlink, link:, which is a reference
|
|
||||||
# to a local file whose path is relative to the --op directory.
|
|
||||||
|
|
||||||
def handle_special_HYPERLINK(special)
|
# Generate a hyperlink for url, labeled with text. Handle the
|
||||||
url = special.text
|
# special cases for img: and link: described under handle_special_HYPEDLINK
|
||||||
|
def gen_url(url, text)
|
||||||
if url =~ /([A-Za-z]+):(.*)/
|
if url =~ /([A-Za-z]+):(.*)/
|
||||||
type = $1
|
type = $1
|
||||||
path = $2
|
path = $2
|
||||||
@ -156,10 +151,22 @@ module Generators
|
|||||||
|
|
||||||
"<img src=\"#{url}\">"
|
"<img src=\"#{url}\">"
|
||||||
else
|
else
|
||||||
"<a href=\"#{url}\">#{url.sub(%r{^\w+:/*}, '')}</a>"
|
"<a href=\"#{url}\">#{text.sub(%r{^\w+:/*}, '')}</a>"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# And we're invoked with a potential external hyperlink mailto:
|
||||||
|
# just gets inserted. http: links are checked to see if they
|
||||||
|
# reference an image. If so, that image gets inserted using an
|
||||||
|
# <img> tag. Otherwise a conventional <a href> is used. We also
|
||||||
|
# support a special type of hyperlink, link:, which is a reference
|
||||||
|
# to a local file whose path is relative to the --op directory.
|
||||||
|
|
||||||
|
def handle_special_HYPERLINK(special)
|
||||||
|
url = special.text
|
||||||
|
gen_url(url, url)
|
||||||
|
end
|
||||||
|
|
||||||
# HEre's a hypedlink where the label is different to the URL
|
# HEre's a hypedlink where the label is different to the URL
|
||||||
# <label>[url]
|
# <label>[url]
|
||||||
#
|
#
|
||||||
@ -171,12 +178,7 @@ module Generators
|
|||||||
end
|
end
|
||||||
label = $1
|
label = $1
|
||||||
url = $2
|
url = $2
|
||||||
|
gen_url(url, label)
|
||||||
unless url =~ /\w+?:/
|
|
||||||
url = "http://#{url}"
|
|
||||||
end
|
|
||||||
|
|
||||||
"<a href=\"#{url}\">#{label}</a>"
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
Loading…
x
Reference in New Issue
Block a user