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: d007b75a9e2bfeabb03abec88127f8aeda9985e9a74a3fbcff8c342feff476f1
4
- data.tar.gz: e9b2b7ab14c48f2fda20f22ff1c691ec99f73d05cd14df2c4e59b3631aa5f603
3
+ metadata.gz: fdc14b1183b281fcbf9b9e8bec94bfa7fb5d805e72541057d843db6681be508e
4
+ data.tar.gz: b409816745ad73d18d0e7e2163910920262c266fb2a7de928d141f2e43a3bd19
5
5
  SHA512:
6
- metadata.gz: f546344f1057a655b542c08cbe80eaaf7e61dd7259aa56b5ecd36c8fe10b043af8229100cf23ffbf0dc34e4407997400f27edc8df3633883b6f9c7f06758e20e
7
- data.tar.gz: 9ded99ef961fbc338226e0edded2985397204c3df576a636181ef84128318b6cc4b88e83148b0714dcc71e1034a984bcd7341bae2bc58878f527207777283320
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]
@@ -8,7 +8,7 @@
8
8
  contenteditable="true"
9
9
  data-field="content"
10
10
  class="form-control markdown-textarea">
11
- <%= raw locals[:attribute] %>
11
+ <%= raw locals[:content] %>
12
12
  </div>
13
13
 
14
14
  <div id="editor_content_placeholder">
@@ -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
- render "ponkotsu_md_editor/editor", locals: { attribute: attribute, form: form, options: options }
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PonkotsuMdEditor
4
- VERSION = "0.2.3"
4
+ VERSION = "0.2.5"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ponkotsu-md-editor
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.3
4
+ version: 0.2.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler