Skip to content

Commit b25b1a4

Browse files
committed
added simple alert for users who add excessive spacing without paragraph breaks
1 parent 48b1e70 commit b25b1a4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

assets/js/app.js

+5
Original file line numberDiff line numberDiff line change
@@ -298,6 +298,11 @@ Hooks.Space = {
298298
this.el.addEventListener("click", (e) => {
299299
const id = e.target.value;
300300
const textarea = document.getElementById(id);
301+
//https://stackoverflow.com/questions/15131072/check-whether-string-contains-a-line-break
302+
var match = /\r|\n/.exec(textarea.value);
303+
if (!match) {
304+
alert('Must contain paragraph breaks to add excessive spaces');
305+
}
301306
textarea.value = textarea.value.replace(/\n/g, "\n\n");
302307
});
303308
},

0 commit comments

Comments
 (0)