mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
FEATURE: Convert HTML to Markdown while pasting in composer
This commit is contained in:
committed by
Joffrey JAFFEUX
parent
067d454937
commit
6e054b2572
12
app/controllers/composer_controller.rb
Normal file
12
app/controllers/composer_controller.rb
Normal file
@@ -0,0 +1,12 @@
|
||||
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
|
||||
Reference in New Issue
Block a user