summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/asciidoctor.rb2
-rw-r--r--lib/asciidoctor/document.rb2
2 files changed, 2 insertions, 2 deletions
diff --git a/lib/asciidoctor.rb b/lib/asciidoctor.rb
index 45c28f6a..386b90c4 100644
--- a/lib/asciidoctor.rb
+++ b/lib/asciidoctor.rb
@@ -92,7 +92,7 @@ module Asciidoctor
@names_by_value = (constants false).map {|sym| [(const_get sym), sym.to_s.downcase] }.sort {|(a), (b)| a <=> b }.to_h
def self.value_for_name name
- const_get name.upcase, false
+ const_get name.upcase, false rescue nil
end
def self.name_for_value value
diff --git a/lib/asciidoctor/document.rb b/lib/asciidoctor/document.rb
index af5fb51d..71fb887a 100644
--- a/lib/asciidoctor/document.rb
+++ b/lib/asciidoctor/document.rb
@@ -323,7 +323,7 @@ class Document < AbstractBlock
# be permissive in case API user wants to define new levels
@safe = safe_mode
else
- @safe = (SafeMode.value_for_name safe_mode) rescue SafeMode::SECURE
+ @safe = (SafeMode.value_for_name safe_mode) || SafeMode::SECURE
end
input_mtime = options.delete :input_mtime
@compat_mode = attr_overrides.key? 'compat-mode'