Set the Safe Mode Using the API

The default safe mode in the API is SECURE. You can change the safe mode using a string, symbol or integer value.

Set :safe option

The value must be set in the document constructor using the :safe option.

result = Asciidoctor.convert_file('master.adoc', safe: 'server')

or

result = Asciidoctor.convert_file('master.adoc', safe: :server)

or

result = Asciidoctor.convert_file('master.adoc', safe: 10)