Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Make encoding-forcing user-configurable.

  • Loading branch information...
commit c2113f9549dbc95901719e7d424d74289bcf7731 1 parent 6827382
@jcoglan jcoglan authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 lib/showoff.rb
View
6 lib/showoff.rb
@@ -36,6 +36,7 @@ class ShowOff < Sinatra::Application
set :page_size, "Letter"
set :pres_template, nil
set :showoff_config, nil
+ set :encoding, nil
def initialize(app=nil)
super(app)
@@ -145,8 +146,11 @@ def empty?
def process_markdown(name, content, static=false, pdf=false)
+ if settings.encoding and content.respond_to?(:force_encoding)
+ content.force_encoding(settings.encoding)
+ end
+
# if there are no !SLIDE markers, then make every H1 define a new slide
- content.force_encoding('UTF-8') if content.respond_to?(:force_encoding)
unless content =~ /^\<?!SLIDE/m
content = content.gsub(/^# /m, "<!SLIDE>\n# ")
end
Please sign in to comment.
Something went wrong with that request. Please try again.