-
Notifications
You must be signed in to change notification settings - Fork 121
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes conversion failure when using erb template (#610)
Internally erubi option was set as null which caused Asciidoctor to fail with 'Unknown ERB implementation'. The fix sets the option only when a non empty value is present, delegating to AsciidoctorJ default which is 'erb' (consistent with current docs).
- Loading branch information
1 parent
d7cb395
commit 319848d
Showing
6 changed files
with
68 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
28 changes: 28 additions & 0 deletions
28
asciidoctor-maven-plugin/src/test/resources/templates/erb/section.html.erb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<%#encoding:UTF-8%><% | ||
slevel = @level.zero? && @special ? 1 : @level | ||
anchor = link_start = link_end = nil | ||
if @id | ||
if @document.attr? :sectanchors | ||
anchor = %(<a class="anchor" href="##{@id}"></a>) | ||
elsif @document.attr? :sectlinks | ||
link_start = %(<a class="link" href="##{@id}">) | ||
link_end = '</a>' | ||
end | ||
end | ||
if slevel.zero? | ||
%><h1<%= @id && %( id="#{@id}") %> class="sect0"><%= %(#{anchor}#{link_start}#{title}#{link_end}) %></h1> | ||
<%= content %><% | ||
else | ||
snum = @numbered && @caption.nil? && slevel <= (@document.attr 'sectnumlevels', 3).to_i ? %(#{sectnum} ) : nil | ||
hlevel = slevel + 1 | ||
%><div class="<%= [%(sect#{slevel}),role].compact * ' ' %>"> | ||
<h<%= hlevel %><%= @id && %( id="#{@id}") %>><%= %(#{anchor}#{link_start}#{snum}#{captioned_title}#{link_end}) %></h<%= hlevel %>><% | ||
if slevel == 1 %> | ||
<div class="sectionbody custom-style"> | ||
<%= content %> | ||
</div><% | ||
else %> | ||
<%= content %><% | ||
end %> | ||
</div><% | ||
end %> |
File renamed without changes.
File renamed without changes.