ponkotsu-md-editor 0.2.3 → 0.2.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: fdc14b1183b281fcbf9b9e8bec94bfa7fb5d805e72541057d843db6681be508e
|
|
4
|
+
data.tar.gz: b409816745ad73d18d0e7e2163910920262c266fb2a7de928d141f2e43a3bd19
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3cf922f54b71cf075ed1d7f58522f2f00eec66811f03197863a8d8af9b7fc0519580e22c2cb7bb96eaed04970f519e4d838502cd21311ca9cb2d6edeb179fbb5
|
|
7
|
+
data.tar.gz: 5ab293fdaf4893e2c1c0385a2160e31a19a0488014f4619c90d1c1d666fa8011ee28076b62657ccb1bb0cc75de95671f04b379c174783311aaf25c4967566a38
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
|
|
60
60
|
<div class="markdown-editor">
|
|
61
61
|
<%= render "ponkotsu_md_editor/toolbar", locals: { options: _options } %>
|
|
62
|
-
<%= render "ponkotsu_md_editor/input_area", locals: { form: _form, attribute: locals[:attribute], options: _options } %>
|
|
62
|
+
<%= render "ponkotsu_md_editor/input_area", locals: { form: _form, attribute: locals[:attribute], content: locals[:content], options: _options } %>
|
|
63
63
|
</div>
|
|
64
64
|
<div class="form-text medium-contrast-text">
|
|
65
65
|
<strong><%= case _options[:lang]
|
|
@@ -12,6 +12,7 @@ module PonkotsuMdEditor
|
|
|
12
12
|
#
|
|
13
13
|
# @param form [ActionView::Helpers::FormBuilder] The form builder object.
|
|
14
14
|
# @param attribute [Symbol, String] The attribute name to bind the editor to (e.g., :content).
|
|
15
|
+
# @param content [String] The initial content to display in the editor.
|
|
15
16
|
# @param options [Hash] Editor configuration options (e.g., :lang, :preview, :tools, :placeholder).
|
|
16
17
|
# @return [String] The rendered HTML for the Markdown editor.
|
|
17
18
|
#
|
|
@@ -22,10 +23,11 @@ module PonkotsuMdEditor
|
|
|
22
23
|
# tools: [:bold, :italic, :strikethrough],
|
|
23
24
|
# placeholder: "This is Placeholder."
|
|
24
25
|
# }) %>
|
|
25
|
-
def markdown_editor(form, attribute, options = {})
|
|
26
|
+
def markdown_editor(form, attribute, content, options = {})
|
|
26
27
|
form = form[:form] if form.is_a?(Hash)
|
|
27
28
|
attribute = attribute[:attribute] if attribute.is_a?(Hash)
|
|
28
|
-
|
|
29
|
+
content = content[:attribute] if content.is_a?(Hash)
|
|
30
|
+
render "ponkotsu_md_editor/editor", locals: { attribute: attribute, content: content, form: form, options: options }
|
|
29
31
|
end
|
|
30
32
|
end
|
|
31
33
|
end
|