diff --git a/pinry/static/css/pinry.css b/pinry/static/css/pinry.css
index 21d722c..8b4fae1 100644
--- a/pinry/static/css/pinry.css
+++ b/pinry/static/css/pinry.css
@@ -243,6 +243,8 @@ textarea {
font-size: 12px;
margin-bottom: 0;
padding: 8px;
+ overflow: hidden;
+ text-overflow: ellipsis;
}
.pin strong {
diff --git a/pinry/static/js/helpers.js b/pinry/static/js/helpers.js
index 33e95e8..9f22a4e 100644
--- a/pinry/static/js/helpers.js
+++ b/pinry/static/js/helpers.js
@@ -58,3 +58,15 @@ function postPinData(data) {
function getUrlParameter(name) {
return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.search)||[,""])[1].replace(/\+/g, '%20'))||null;
}
+
+Handlebars.registerHelper('niceLinks', (function () {
+ var reNL = /\r?\n/g,
+ reURL = /https?:[/][/](?:www[.])?([^/]+)(?:[/]([.]?[^\s,.])+)?/g;
+ return function (text) {
+ var t = Handlebars.Utils.escapeExpression(text);
+ t = t.replace(reURL, '$1');
+ t = t.replace(reNL, '
');
+ return new Handlebars.SafeString(t);
+ };
+})());
+
diff --git a/pinry/templates/includes/lightbox.html b/pinry/templates/includes/lightbox.html
index 1c558c7..d903575 100644
--- a/pinry/templates/includes/lightbox.html
+++ b/pinry/templates/includes/lightbox.html
@@ -8,7 +8,7 @@
{{description}}
+{{niceLinks description}}
{{/if}}