fix preview
This commit is contained in:
parent
3004074e2e
commit
2175a898be
|
@ -57,7 +57,7 @@ CommentsController = (Comment, Preview, confirmMessage, $scope, compileHTML, $ro
|
|||
|
||||
promise = Preview.get_preview(vm.project, body)
|
||||
promise.success( (response) ->
|
||||
vm.preview_body = response
|
||||
vm.preview_body = response.html
|
||||
Preview.old_text = body
|
||||
).error( (response) ->
|
||||
vm.preview_body = 'Error :('
|
||||
|
|
|
@ -46,7 +46,7 @@ IssueController = (dataservice, $http, Issue, $rootScope, Preview, Label, confir
|
|||
|
||||
promise = Preview.get_preview(vm.project, body)
|
||||
promise.success( (response) ->
|
||||
vm.preview_body = response
|
||||
vm.preview_body = response.html
|
||||
Preview.old_text = body
|
||||
).error( (response) ->
|
||||
vm.preview_body = 'Error :('
|
||||
|
|
|
@ -4,14 +4,8 @@ previewService = ($http) ->
|
|||
old_text: old_text
|
||||
get_preview: (name_with_owner, text, old_text) ->
|
||||
return null if text is old_text
|
||||
path = Routes.project_md_preview_path(
|
||||
{
|
||||
name_with_owner: name_with_owner,
|
||||
text: text
|
||||
}
|
||||
)
|
||||
$http.post(path)
|
||||
|
||||
path = Routes.project_md_preview_path(name_with_owner)
|
||||
$http.post(path, {text: text})
|
||||
}
|
||||
|
||||
angular
|
||||
|
|
|
@ -166,7 +166,10 @@ class Projects::ProjectsController < Projects::BaseController
|
|||
end
|
||||
|
||||
def preview
|
||||
render inline: view_context.markdown(params[:text]), layout: false
|
||||
respond_to do |format|
|
||||
format.json {}
|
||||
format.html {render inline: view_context.markdown(params[:text]), layout: false}
|
||||
end
|
||||
end
|
||||
|
||||
def refs_list
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
json.html markdown(params[:text])
|
Loading…
Reference in New Issue