ponkotsu-md-editor 0.2.33 → 0.2.34
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 +4 -4
- data/app/assets/javascripts/markdown_editor.js +12 -4
- data/lib/ponkotsu/md/editor/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: e3b1c79f7f7011ffcd76111ea8598c5346790a17feb8c0a6e7f34b1ff7109176
|
|
4
|
+
data.tar.gz: 753c49c6d2c30d63059ff982b4f0620cecf94f6f1e5ef2b00f70814112dc35ee
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0337a5e3775a7b445a0eec9dfb92c2f3eeda5925fafdcb408496a2010bebb9bc0ab63d1689b45de015a0946c0a5c7674f1b0f8a76f1e9bd2b464e1828eaf8963
|
|
7
|
+
data.tar.gz: 719c69fa598fb5a7983cf8ab277c3d4246763569eeb1e72e9083bd9040fbbc37f0fadce92ddca229c3eae3719d1ad22d5d8431f198a5136a9c5ec90909b65ff8
|
|
@@ -161,10 +161,18 @@
|
|
|
161
161
|
|
|
162
162
|
// 初期状態でプレースホルダを表示するための空要素チェック
|
|
163
163
|
function updatePlaceholderVisibility() {
|
|
164
|
-
//
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
164
|
+
// innerHTML を一度だけ取得してキャッシュ
|
|
165
|
+
const html = textarea.innerHTML.trim();
|
|
166
|
+
|
|
167
|
+
// 空判定を簡潔に
|
|
168
|
+
const isEmpty = html === '' ||
|
|
169
|
+
html === ' ' ||
|
|
170
|
+
html === '<br>' ||
|
|
171
|
+
html === '<div><br></div>' ||
|
|
172
|
+
html === '<div></div>' ||
|
|
173
|
+
html === '<div> </div>';
|
|
174
|
+
|
|
175
|
+
if (isEmpty) {
|
|
168
176
|
textarea.classList.add('empty');
|
|
169
177
|
} else {
|
|
170
178
|
textarea.classList.remove('empty');
|