Install and use ToastUi markdown editor

Replace all usages of pagedown-bootstrap editor with the new editor.
Add styles to ensure the editor preview matches the final output.
This commit is contained in:
Julia Casamitjana
2024-04-11 10:34:37 +02:00
committed by Dominic Sauer
parent 96f5f1f8d7
commit 9c71c6667a
10 changed files with 362 additions and 37 deletions

View File

@@ -1,3 +1,10 @@
- content_for :head do
// Force a full page reload, see https://github.com/turbolinks/turbolinks/issues/326.
Otherwise, code might not be highlighted correctly (race condition)
meta name='turbolinks-visit-control' content='reload'
- append_javascript_pack_tag('toast-ui')
- append_stylesheet_pack_tag('toast-ui')
= form_for(@tip, builder: PagedownFormBuilder) do |f|
= render('shared/form_errors', object: @tip)
.mb-3
@@ -5,7 +12,7 @@
= f.text_field(:title, class: 'form-control', required: false)
.mb-3
= f.label(:description, class: 'form-label')
= f.pagedown :description, input_html: {preview: true, rows: 5}
= f.pagedown :description
.mb-3
= f.label(:file_type_id, t('activerecord.attributes.file.file_type_id'), class: 'form-label')
= f.collection_select(:file_type_id, @file_types, :id, :name, {include_blank: true}, class: 'form-control')