Disable internal link processing for asciidoc

asciidoc's representation of section identifiers interferes with
Gollum's page linking. This disables Gollum's page link tag
extraction for asciidoc files.

Adds "apt-get install -y asciidoc" to .travis.yml so tests pass
on @travis-ci.
This commit is contained in:
Ryan Fowler
2012-05-01 11:43:27 -05:00
parent 9dba3f9c58
commit d1cf698b45
3 changed files with 18 additions and 0 deletions
+2
View File
@@ -4,3 +4,5 @@ rvm:
- rbx-2.0
notifications:
disabled: true
before_install:
- sudo apt-get install -y asciidoc
+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