Merge pull request #303 from rwfowler/asciidocLinks

Fix for #52 - Disable internal link processing for asciidoc
This commit is contained in:
Corey Donohoe
2012-05-01 10:42:31 -07:00
2 changed files with 16 additions and 0 deletions
+3
View File
@@ -116,6 +116,9 @@ module Gollum
#
# Returns the placeholder'd String data.
def extract_tags(data)
if @format == :asciidoc
return data
end
data.gsub!(/(.?)\[\[(.+?)\]\]([^\[]?)/m) do
if $1 == "'" && $3 != "'"
"[[#{$2}]]#{$3}"
+13
View File
@@ -588,6 +588,19 @@ np.array([[2,2],[1,3]],np.float)
compare(content, output, 'md')
end
#########################################################################
# Asciidoc
#########################################################################
test "asciidoc header" do
compare("= Book Title\n\n== Heading", '<div class="sect1"><h2 id="wiki-_heading">Heading</h2><div class="sectionbody"></div></div>', 'asciidoc')
end
test "internal links with asciidoc" do
compare("= Book Title\n\n[[anid]]\n== Heading", '<div class="sect1"><h2 id="wiki-anid">Heading</h2><div class="sectionbody"></div></div>', 'asciidoc')
end
#########################################################################
#
# Helpers