lib/awestruct/handlers/asciidoctor_handler.rb in awestruct-0.6.1 vs lib/awestruct/handlers/asciidoctor_handler.rb in awestruct-0.6.2
- old
+ new
@@ -1,6 +1,7 @@
require 'awestruct/handler_chain'
+require 'awestruct/util/yaml_load'
require 'awestruct/handlers/base_tilt_handler'
require 'awestruct/handlers/file_handler'
require 'awestruct/handlers/layout_handler'
require 'awestruct/handlers/template/asciidoc'
require 'yaml'
@@ -134,10 +135,10 @@
def parse_document_attributes(content)
template = ::Tilt::new(delegate.path.to_s, delegate.content_line_offset + 1, options)
headers = template.parse_headers(content, /^(?:page|awestruct)\-(?=.)/).inject({'interpolate' => false}) do |hash, (k,v)|
unless v.nil?
- hash[k] = v.empty? ? v : YAML.load(v)
+ hash[k] = v.empty? ? v : Awestruct.yaml_load(v)
if hash[k].kind_of? Time
# use DateTime to preserve timezone information
hash[k] = DateTime.parse(v)
end
end