rails 3 fixes

This commit is contained in:
2013-07-14 11:11:18 -04:00
parent e563725dc5
commit 0991d7af8e
46 changed files with 164 additions and 129 deletions

View File

@@ -73,7 +73,7 @@ module ApplicationHelper
def markup_help
return "<div id='markup_help' style='display: none'>" +
File.read("#{RAILS_ROOT}/public/static/markup_help.mkd").format_wiki +
File.read("#{Rails.root}/public/static/markup_help.mkd").format_wiki +
"</div>"
end

View File

@@ -16,10 +16,11 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
class String
include ActionView::Helpers::SanitizeHelper
def format_wiki
text = BlueCloth.new(self).to_html
text = Hpricot(text, :xhtml_strict => true).to_s
return text.sanitize unless text.blank?
return sanitize text
end
end