gem 'RedCloth' # allow :textile in HAML
gem 'sass-rails' # not sure why can't be in :assets group
gem 'pandoc-ruby'
+unless RUBY_VERSION =~ /1.8/
+ gem 'iconv' # required for older pandoc
+end
# Gems used only for assets and not required
# in production environments by default.
require 'pathname'
require 'RedCloth'
require 'pandoc-ruby'
+require 'iconv'
class StaticPage
attr_accessor :path, :children, :name, :file_path, :props, :parent, :mount_point, :locales
}
def render_pandoc(string, suffix, locale)
+ string = Iconv.conv("UTF-8//IGNORE", "UTF-8", string) # remove illegal utf-8
args = [string, {:from => PANDOC_FORMATS[suffix], :to => :html}, "smart"]
if props.locale(locale).toc != false
args << "table_of_contents"