ponkotsu-md-editor 0.1.28 → 0.1.30

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: a65b192afe985862cc30596413f33700d73b37554056e49699b8539c2d91b916
4
- data.tar.gz: 75a37e81090cc5588b0a66e59679499a7ee9c9c48329a41ba803a7e2e6a2c1b2
3
+ metadata.gz: 78b9307ca464fe68ab92aa6503456c8d37b92cccade83df5cecb85a1d38a9620
4
+ data.tar.gz: 9a26b6853ae9c65d8929c7819cc1c23d7994668d59bb990c80336c37d19ddf3d
5
5
  SHA512:
6
- metadata.gz: 0076b2388010cd9d424d2aff825c2e7e0956a2a0d31626194b576f158de9135affa3724d59e39154b577b7302967215bee1d6a2aea265ef9f19383a19f81e861
7
- data.tar.gz: c582d4020bf52d12cfb2d7c26a253ac9a645874e5ac0d3ee75979a4d94f08ddba3737ed1b8d476e27a3c2563d1f9f462ab5d358550192930708629cf19a2e32d
6
+ metadata.gz: f56ce70569efbb1e86ed4a69aadc3b7a4ecf7057d27ee4c80e12c078c5da3764fac0d1b17004bbb2f5a07daf1ed127a4bca3d7c6ace96f08d68488c2b19ca7cf
7
+ data.tar.gz: 1e012b1ae5052d141896a6ca9ca9287a66a506abd0642dff35f620c2bfd5987f5da78c910d2dfecd52865c02844261604ec16b5c1d90a7efad38f04fe5092551
@@ -113,6 +113,18 @@
113
113
  // Get actual selected text from innerText
114
114
  const selectedText = fullText.substring(startPos, endPos);
115
115
 
116
+ // === デバッグ出力 ===
117
+ console.log('[DEBUG] getContentEditableSelection');
118
+ console.log('fullText:', JSON.stringify(fullText));
119
+ console.log('startPos:', startPos, 'endPos:', endPos);
120
+ console.log('selectedText:', JSON.stringify(selectedText));
121
+ console.log('textNodes:', textNodes.map(n => n.textContent));
122
+ console.log('range.startContainer:', range.startContainer);
123
+ console.log('range.startOffset:', range.startOffset);
124
+ console.log('range.endContainer:', range.endContainer);
125
+ console.log('range.endOffset:', range.endOffset);
126
+ // ===================
127
+
116
128
  return {
117
129
  start: startPos,
118
130
  end: endPos,
@@ -24,117 +24,117 @@
24
24
  <div class="editor-toolbar mb-2">
25
25
  <div class="btn-group btn-group-sm" role="group">
26
26
  <% if enable_bold %>
27
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('**', '**')" title="太字 (Ctrl+B)">
27
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-bold-btn" onclick="insertMarkdown('**', '**')" title="太字 (Ctrl+B)">
28
28
  <i class="bi bi-type-bold"></i>
29
29
  </button>
30
30
  <% end %>
31
31
 
32
32
  <% if enable_italic %>
33
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('*', '*')" title="斜体 (Ctrl+I)">
33
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-italic-btn" onclick="insertMarkdown('*', '*')" title="斜体 (Ctrl+I)">
34
34
  <i class="bi bi-type-italic"></i>
35
35
  </button>
36
36
  <% end %>
37
37
 
38
38
  <% if enable_strikethrough %>
39
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('~~', '~~')" title="打ち消し線">
39
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-strikethrough-btn" onclick="insertMarkdown('~~', '~~')" title="打ち消し線">
40
40
  <i class="bi bi-type-strikethrough"></i>
41
41
  </button>
42
42
  <% end %>
43
43
 
44
44
  <% if enable_code %>
45
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('`', '`')" title="インラインコード">
45
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-code-btn" onclick="insertMarkdown('`', '`')" title="インラインコード">
46
46
  <i class="bi bi-code"></i>
47
47
  </button>
48
48
  <% end %>
49
49
  </div>
50
50
  <div class="btn-group btn-group-sm ms-2" role="group">
51
51
  <% if enable_heading1 %>
52
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('# ', '')" title="見出し1">
52
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-heading1-btn" onclick="insertMarkdown('# ', '')" title="見出し1">
53
53
  <i class="bi bi-type-h1"></i>
54
54
  </button>
55
55
  <% end %>
56
56
 
57
57
  <% if enable_heading2 %>
58
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('## ', '')" title="見出し2">
58
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-heading2-btn" onclick="insertMarkdown('## ', '')" title="見出し2">
59
59
  <i class="bi bi-type-h2"></i>
60
60
  </button>
61
61
  <% end %>
62
62
 
63
63
  <% if enable_heading3 %>
64
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('### ', '')" title="見出し3">
64
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-heading3-btn" onclick="insertMarkdown('### ', '')" title="見出し3">
65
65
  <i class="bi bi-type-h3"></i>
66
66
  </button>
67
67
  <% end %>
68
68
 
69
69
  <% if enable_heading4 %>
70
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('#### ', '')" title="見出し4">
70
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-heading4-btn" onclick="insertMarkdown('#### ', '')" title="見出し4">
71
71
  <i class="bi bi-type-h4"></i>
72
72
  </button>
73
73
  <% end %>
74
74
 
75
75
  <% if enable_heading5 %>
76
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('##### ', '')" title="見出し5">
76
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-heading5-btn" onclick="insertMarkdown('##### ', '')" title="見出し5">
77
77
  <i class="bi bi-type-h5"></i>
78
78
  </button>
79
79
  <% end %>
80
80
 
81
81
  <% if enable_heading6 %>
82
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('###### ', '')" title="見出し6">
82
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-heading6-btn" onclick="insertMarkdown('###### ', '')" title="見出し6">
83
83
  <i class="bi bi-type-h6"></i>
84
84
  </button>
85
85
  <% end %>
86
86
  </div>
87
87
  <div class="btn-group btn-group-sm ms-2" role="group">
88
88
  <% if enable_link %>
89
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('[', '](URL)')" title="リンク">
89
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-link-btn" onclick="insertMarkdown('[', '](URL)')" title="リンク">
90
90
  <i class="bi bi-link-45deg"></i>
91
91
  </button>
92
92
  <% end %>
93
93
 
94
94
  <% if enable_unordered_list %>
95
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('- ', '')" title="箇条書きリスト">
95
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-unordered-list-btn" onclick="insertMarkdown('- ', '')" title="箇条書きリスト">
96
96
  <i class="bi bi-list-ul"></i>
97
97
  </button>
98
98
  <% end %>
99
99
 
100
100
  <% if enable_ordered_list %>
101
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('1. ', '')" title="番号付きリスト">
101
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-ordered-list-btn" onclick="insertMarkdown('1. ', '')" title="番号付きリスト">
102
102
  <i class="bi bi-list-ol"></i>
103
103
  </button>
104
104
  <% end %>
105
105
 
106
106
  <% if enable_code_block %>
107
- <button type="button" class="btn btn-outline-secondary" onclick="insertCode()" title="コードスパンまたはコードブロック">
107
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-code-block-btn" onclick="insertCode()" title="コードスパンまたはコードブロック">
108
108
  <i class="bi bi-code-square"></i>
109
109
  </button>
110
110
  <% end %>
111
111
 
112
112
  <% if enable_blockquote %>
113
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('> ', '')" title="引用">
113
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-blockquote-btn" onclick="insertMarkdown('> ', '')" title="引用">
114
114
  <i class="bi bi-quote"></i>
115
115
  </button>
116
116
  <% end %>
117
117
 
118
118
  <% if enable_image %>
119
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('![', '](画像URL)')" title="画像">
119
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-image-btn" onclick="insertMarkdown('![', '](画像URL)')" title="画像">
120
120
  <i class="bi bi-image"></i>
121
121
  </button>
122
122
  <% end %>
123
123
 
124
124
  <% if enable_table %>
125
- <button type="button" class="btn btn-outline-secondary" onclick="insertTable()" title="テーブル">
125
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-table-btn" onclick="insertTable()" title="テーブル">
126
126
  <i class="bi bi-table"></i>
127
127
  </button>
128
128
  <% end %>
129
129
 
130
130
  <% if enable_horizontal_rule %>
131
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('\n---\n', '')" title="水平線">
131
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-horizontal-rule-btn" onclick="insertMarkdown('\n---\n', '')" title="水平線">
132
132
  <i class="bi bi-dash-lg"></i>
133
133
  </button>
134
134
  <% end %>
135
135
 
136
136
  <% if enable_check_list %>
137
- <button type="button" class="btn btn-outline-secondary" onclick="insertMarkdown('- [ ] ', '')" title="チェックボックス">
137
+ <button type="button" class="btn btn-outline-secondary" id="toolbar-check-list-btn" onclick="insertMarkdown('- [ ] ', '')" title="チェックボックス">
138
138
  <i class="bi bi-check-square"></i>
139
139
  </button>
140
140
  <% end %>
@@ -142,7 +142,7 @@
142
142
 
143
143
  <% if enable_preview %>
144
144
  <div class="btn-group btn-group-sm ms-2" role="group">
145
- <button type="button" class="btn btn-outline-primary" onclick="togglePreview()" id="previewToggle">
145
+ <button type="button" class="btn btn-outline-primary" id="toolbar-preview-btn" onclick="togglePreview()">
146
146
  <i class="bi bi-eye"></i> プレビュー
147
147
  </button>
148
148
  </div>
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module PonkotsuMdEditor
4
- VERSION = "0.1.28"
4
+ VERSION = "0.1.30"
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.1.28
4
+ version: 0.1.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - dhq_boiler