summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean McGivern <sean@mcgivern.me.uk>2018-02-16 13:26:41 +0000
committerSean McGivern <sean@mcgivern.me.uk>2018-02-16 13:26:41 +0000
commit89854139a4bcdd0cc16b67e7c49ec781aee70036 (patch)
treea42d1944f5ab1d3cd250274ed90d27d6fe81403e
parent5a6850c416ee13d93841624c35f07587b6ab2d23 (diff)
parent9a450aedc2c81f8ce17e4c9b4238c58edbef8269 (diff)
downloadgitlab-ce-89854139a4bcdd0cc16b67e7c49ec781aee70036.tar.gz
Merge branch 'asciidoc_inter_document_cross_references' into 'master'
Set Asciidoctor outfilesuffix to default .adoc Closes #43192 and #17602 See merge request gitlab-org/gitlab-ce!17125
-rw-r--r--changelogs/unreleased/asciidoc_inter_document_cross_references.yml5
-rw-r--r--lib/gitlab/asciidoc.rb3
-rw-r--r--spec/lib/gitlab/asciidoc_spec.rb8
3 files changed, 15 insertions, 1 deletions
diff --git a/changelogs/unreleased/asciidoc_inter_document_cross_references.yml b/changelogs/unreleased/asciidoc_inter_document_cross_references.yml
new file mode 100644
index 00000000000..34b26753312
--- /dev/null
+++ b/changelogs/unreleased/asciidoc_inter_document_cross_references.yml
@@ -0,0 +1,5 @@
+---
+title: Asciidoc now support inter-document cross references between files in repository
+merge_request: 17125
+author: Turo Soisenniemi
+type: changed
diff --git a/lib/gitlab/asciidoc.rb b/lib/gitlab/asciidoc.rb
index ee7f4be6b9f..62c41801d75 100644
--- a/lib/gitlab/asciidoc.rb
+++ b/lib/gitlab/asciidoc.rb
@@ -8,7 +8,8 @@ module Gitlab
module Asciidoc
DEFAULT_ADOC_ATTRS = [
'showtitle', 'idprefix=user-content-', 'idseparator=-', 'env=gitlab',
- 'env-gitlab', 'source-highlighter=html-pipeline', 'icons=font'
+ 'env-gitlab', 'source-highlighter=html-pipeline', 'icons=font',
+ 'outfilesuffix=.adoc'
].freeze
# Public: Converts the provided Asciidoc markup into HTML.
diff --git a/spec/lib/gitlab/asciidoc_spec.rb b/spec/lib/gitlab/asciidoc_spec.rb
index f668f78c2b8..2a0e19ae796 100644
--- a/spec/lib/gitlab/asciidoc_spec.rb
+++ b/spec/lib/gitlab/asciidoc_spec.rb
@@ -95,6 +95,14 @@ module Gitlab
expect(render(input, context)).to include('<p><code data-math-style="inline" class="code math js-render-math">2+2</code> is 4</p>')
end
end
+
+ context 'outfilesuffix' do
+ it 'defaults to adoc' do
+ output = render("Inter-document reference <<README.adoc#>>", context)
+
+ expect(output).to include("a href=\"README.adoc\"")
+ end
+ end
end
def render(*args)