Fix live_preview option #374.
This commit is contained in:
@@ -76,7 +76,7 @@ module Precious
|
||||
@name = params[:splat].first
|
||||
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
||||
if page = wiki.page(@name)
|
||||
if settings.wiki_options[:live_preview] && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
|
||||
if wiki.live_preview && page.format.to_s.include?('markdown') && supported_useragent?(request.user_agent)
|
||||
redirect '/livepreview/index.html?page=' + encodeURIComponent(@name)
|
||||
else
|
||||
@page = page
|
||||
|
||||
@@ -133,6 +133,9 @@ module Gollum
|
||||
# Gets the Array of chars to sub for ws in filenames.
|
||||
attr_reader :ws_subs
|
||||
|
||||
# Gets the boolean live preview value.
|
||||
attr_reader :live_preview
|
||||
|
||||
# Public: Initialize a new Gollum Repo.
|
||||
#
|
||||
# path - The String path to the Git repository that holds the Gollum
|
||||
|
||||
Reference in New Issue
Block a user