Skip to content

Commit

Permalink
Merge pull request gollum#303 from rwfowler/asciidocLinks
Browse files Browse the repository at this point in the history
Fix for gollum#52 - Disable internal link processing for asciidoc
  • Loading branch information
atmos committed May 1, 2012
2 parents b7fb4c5 + f73c925 commit 8fbbe40
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 0 deletions.
3 changes: 3 additions & 0 deletions lib/gollum/markup.rb
Expand Up @@ -116,6 +116,9 @@ def process_tex(data)
#
# 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}"
Expand Down
13 changes: 13 additions & 0 deletions test/test_markup.rb
Expand Up @@ -588,6 +588,19 @@ def assert_markup_highlights_code(markup_class, rendered)
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
Expand Down

0 comments on commit 8fbbe40

Please sign in to comment.