lib/awestruct/handlers/front_matter_handler.rb in awestruct-0.5.0.cr vs lib/awestruct/handlers/front_matter_handler.rb in awestruct-0.5.0
- old
+ new
@@ -40,10 +40,13 @@
def parse_parts
return if ( @parsed_parts && ! delegate.stale? )
full_content = delegate.raw_content
- full_content.force_encoding(site.encoding) if site.encoding
+
+ #if force_encoding is supported then set to charset defined in site config
+ full_content.force_encoding(site.encoding) if (full_content.respond_to?(:force_encoding) && site.encoding)
+
yaml_content = ''
dash_lines = 0
mode = :yaml