BigW Consortium Gitlab

Commit 9a450aed by Turo Soisenniemi

Set Asciidoctor outfilesuffix to default .adoc

Without setting outfilesuffix Asciidoctor defaults to .html. When .html is used, inter-document cross references do not work in Gitlab's repository / file renderer. See more information from http://asciidoctor.org/docs/user-manual/#navigating-between-source-files and http://asciidoctor.org/docs/user-manual/#inter-document-cross-references
parent dd633bc1
---
title: Asciidoc now support inter-document cross references between files in repository
merge_request: 17125
author: Turo Soisenniemi
type: changed
......@@ -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.
......
......@@ -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)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment