Merge branch 'org-mode-file-links' of https://github.com/hugoduncan/gollum into hugoduncan-org-mode-file-links

This commit is contained in:
rick
2011-01-17 10:12:50 -08:00
2 changed files with 18 additions and 1 deletions
+12 -1
View File
@@ -121,7 +121,18 @@ module Gollum
if $1 == "'" && $3 != "'"
"[[#{$2}]]#{$3}"
elsif $2.include?('][')
$&
if $2[0..4] == 'file:'
pre = $1
post = $3
parts = $2.split('][')
parts[0][0..4] = ""
link = "#{parts[1]}|#{parts[0].sub(/\.org/,'')}"
id = Digest::SHA1.hexdigest(link)
@tagmap[id] = link
"#{pre}#{id}#{post}"
else
$&
end
else
id = Digest::SHA1.hexdigest($2)
@tagmap[id] = $2
+6
View File
@@ -440,6 +440,12 @@ context "Markup" do
compare(content, output, 'org')
end
test "org mode style double file links" do
content = "a [[file:f.org][Google]] b"
output = "<p class=\"title\">a <a class=\"internal absent\" href=\"/f\">Google</a> b</p>"
compare(content, output, 'org')
end
#########################################################################
#
# TeX