This repository has been archived on 2023-03-18. You can view files and clone it, but cannot push or open issues or pull requests.
osr-discourse-src/app/controllers/composer_controller.rb
Sam 41986cdb2f Refactor requires login logic, reduce duplicate code
This also corrects the positioning in the chain of the check
and removes misuse of prepend_before_action
2018-02-01 15:17:59 +11:00

13 lines
246 B
Ruby

require_dependency 'html_to_markdown'
class ComposerController < ApplicationController
requires_login
def parse_html
markdown_text = HtmlToMarkdown.new(params[:html]).to_markdown
render json: { markdown: markdown_text }
end
end