Skip to content

Commit

Permalink
Fix asciidoc include support.
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Vlasenko committed Jun 22, 2015
1 parent 7609d3a commit ecf916a
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 5 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ apply plugin: 'groovy'
apply plugin: 'idea'
apply plugin: 'signing'
group = 'com.sysgears.grain'
version = '0.6.3'
version = '0.6.4'
defaultTasks 'build'

def mainClassName = 'com.sysgears.grain.Main'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public class AsciiDoctorProcessor implements Service, MarkupProcessor {
*/
public String process(String source) {
ruby.rpc.with {
AsciidocBridge.convert(source, 'coderay')
AsciidocBridge.convert(source)
}
}

Expand Down
2 changes: 1 addition & 1 deletion src/main/resources/application.properties
Original file line number Diff line number Diff line change
@@ -1 +1 @@
grain.version=0.6.3
grain.version=0.6.4
10 changes: 8 additions & 2 deletions tools/asciidoc-bridge/asciidoc_bridge.rb
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
require 'asciidoctor'

module AsciidocBridge
def convert(source, highlighter)
Asciidoctor.render(source, :attributes => { "source-highlighter" => "coderay" })
def convert(source)
begin
return Asciidoctor.convert(source, :safe => 0, :attributes => { "source-highlighter" => "coderay" })
rescue Exception => e
STDERR.puts e.inspect
STDERR.puts e.backtrace
return "<pre>" + ["#{e.backtrace.first}: #{e.message} (#{e.class})", e.backtrace.drop(1).map{|s| "\t#{s}"}].join("\n") + "</pre>"
end
end

module_function :convert
Expand Down

0 comments on commit ecf916a

Please sign in to comment.