From 1086fba7da15cb87065a07b3b9cb6c4da58312da Mon Sep 17 00:00:00 2001 From: bootstraponline Date: Wed, 2 May 2012 16:58:49 -0600 Subject: [PATCH] Only use live preview for editing markdown pages. --- lib/gollum/frontend/app.rb | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/gollum/frontend/app.rb b/lib/gollum/frontend/app.rb index 05db3563..0d962e30 100644 --- a/lib/gollum/frontend/app.rb +++ b/lib/gollum/frontend/app.rb @@ -46,9 +46,14 @@ module Precious @name = params[:splat].first wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options) if page = wiki.page(@name) - @page = page - @content = page.raw_data - mustache :edit + if page.format.to_s.include?('markdown') + # TODO: Use encodeURIComponent on page name. + redirect '/livepreview/index.html?page=' + @name + else + @page = page + @content = page.raw_data + mustache :edit + end else mustache :create end