Merge pull request #12 from PopulateTools/store-processed-html-from-markdown

Store DraftVersion processed html
This commit is contained in:
Fernando Blat
2016-12-14 12:07:15 +01:00
committed by GitHub
6 changed files with 44 additions and 3 deletions

View File

@@ -4,6 +4,7 @@ App.MarkdownEditor =
textarea_content = element.find('textarea').val()
result = md.render(textarea_content)
element.find('#markdown-preview').html(result)
element.find('#markdown-result input').val(result)
initialize: ->
$('.markdown-editor').each ->

View File

@@ -36,7 +36,8 @@ class Admin::Legislation::DraftVersionsController < Admin::Legislation::BaseCont
:changelog,
:status,
:final_version,
:body
:body,
:body_html
)
end
end

View File

@@ -69,6 +69,9 @@
</div>
<div id="markdown-preview" class="small-12 medium-6 column">
</div>
<div id="markdown-result">
<%= f.hidden_field :body_html, label: false %>
</div>
</div>
</div>