Skip to content

Commit b54253d

Browse files
committed
Merge branch 'main' of https://github.com/cbh123/shlinked
2 parents e9d267a + c556ad6 commit b54253d

File tree

3 files changed

+13
-7
lines changed

3 files changed

+13
-7
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ in order to craft an excellent pull request:
8282
2. If you cloned a while ago, get the latest changes from upstream, and update your fork:
8383

8484
```bash
85-
git checkout master
86-
git pull upstream master
85+
git checkout main
86+
git pull upstream main
8787
git push
8888
```
8989

assets/js/app.js

+7-1
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,13 @@ Hooks.Space = {
298298
this.el.addEventListener("click", (e) => {
299299
const id = e.target.value;
300300
const textarea = document.getElementById(id);
301-
textarea.value = textarea.value.replace(/\n/g, "\n\n");
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+
document.getElementById('advancedFeatureErrorBox').innerText = 'Must include paragraph breaks to add excessive spaces';
305+
} else {
306+
textarea.value = textarea.value.replace(/\n/g, "\n\n");
307+
}
302308
});
303309
},
304310
};

lib/shlinkedin_web/live/post_live/form_component.html.leex

+4-4
Original file line numberDiff line numberDiff line change
@@ -195,15 +195,15 @@
195195
class="inline-flex mt-2 items-center px-3 py-2 border border-gray-300 shadow-sm text-sm leading-4 font-medium rounded-md text-gray-700 bg-white hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500">
196196
🧩
197197
bIzArRo</button>
198-
199-
200-
201-
202198
</div>
203199

204200

205201

206202

203+
<div
204+
class="text-red-500 font-semibold italic text-xs">
205+
<p id="advancedFeatureErrorBox"></p>
206+
</div>
207207
<div class="flex justify-end mt-8 bg-gray-100 -m-5 p-5 rounded-lg">
208208

209209
<%= live_patch "Cancel", to: @return_to, class: "ml-3 inline-flex justify-center py-2 px-4 border border-gray-300 shadow-sm text-sm font-medium rounded-full text-gray-600 bg-white hover:bg-gray-200 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-blue-500"%>

0 commit comments

Comments
 (0)