mirror of
https://github.com/discourse/discourse.git
synced 2024-11-29 20:24:05 -06:00
13 lines
263 B
Ruby
13 lines
263 B
Ruby
require_dependency 'html_to_markdown'
|
|
|
|
class ComposerController < ApplicationController
|
|
|
|
before_action :ensure_logged_in
|
|
|
|
def parse_html
|
|
markdown_text = HtmlToMarkdown.new(params[:html]).to_markdown
|
|
|
|
render json: { markdown: markdown_text }
|
|
end
|
|
end
|