diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb
index eea419126..e22227523 100644
--- a/app/controllers/application_controller.rb
+++ b/app/controllers/application_controller.rb
@@ -67,6 +67,8 @@ class ApplicationController < ActionController::Base
   rescue_from Discourse::NotFound do
     if !request.format || request.format.html?
       # for now do a simple remap, we may look at cleaner ways of doing the render
+      #
+      # Sam: I am confused about this, we need a comment that explains why this is conditional
       raise ActiveRecord::RecordNotFound
     else
       render file: 'public/404', formats: [:html], layout: false, status: 404
diff --git a/app/controllers/posts_controller.rb b/app/controllers/posts_controller.rb
index 3bb93c099..774a4dcd5 100644
--- a/app/controllers/posts_controller.rb
+++ b/app/controllers/posts_controller.rb
@@ -7,7 +7,16 @@ class PostsController < ApplicationController
   before_filter :ensure_logged_in, except: [:show, :replies, :by_number, :short_link]
 
   skip_before_filter :store_incoming_links, only: [:short_link]
-  skip_before_filter :check_xhr, only: [:short_link]
+  skip_before_filter :check_xhr, only: [:markdown,:short_link]
+
+  def markdown
+    post = Post.where(topic_id: params[:topic_id].to_i, post_number: (params[:post_number] || 1).to_i).first
+    if post && guardian.can_see?(post)
+      render text: post.raw, content_type: 'text/plain'
+    else
+      raise Discourse::NotFound
+    end
+  end
 
   def short_link
     post = Post.find(params[:post_id].to_i)
diff --git a/config/routes.rb b/config/routes.rb
index a770a87c4..eabab717f 100644
--- a/config/routes.rb
+++ b/config/routes.rb
@@ -205,6 +205,8 @@ Discourse::Application.routes.draw do
 
   post 't/:topic_id/notifications' => 'topics#set_notifications' , constraints: {topic_id: /\d+/}
 
+  get 'md/:topic_id(/:post_number)' => 'posts#markdown'
+
 
   resources :invites
   delete 'invites' => 'invites#destroy'