-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathiframely-date.diff
47 lines (45 loc) · 2.15 KB
/
iframely-date.diff
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff --git a/library.js b/library.js
index 8ba5b21..20029e1 100644
--- a/library.js
+++ b/library.js
@@ -174,7 +174,8 @@ iframely.replace = function(raw, options, callback) {
title: embed.meta.title || url,
embed: embed,
icon: icon,
- url: url
+ url: url,
+ date: validator.escape(embed.meta.date || '')
}, function (err, parsed) {
if (err) {
winston.error('[plugin/iframely] Could not parse embed: ' + err.message + '. Url: ' + url);
@@ -233,6 +234,7 @@ iframely.replace = function(raw, options, callback) {
favicon: wrapImage(icon),
embed: embed,
url: url,
+ date: validator.escape(embed.meta.date || ''),
metaString: metaInfo.length ? metaInfo.join(' / ') : false,
embedHtml: embedHtml,
embedIsImg: /^<img[^>]+>$/.test(embedHtml),
diff --git a/public/templates/partials/iframely-link-title.tpl b/public/templates/partials/iframely-link-title.tpl
index ee16400..95b9d74 100644
--- a/public/templates/partials/iframely-link-title.tpl
+++ b/public/templates/partials/iframely-link-title.tpl
@@ -1,6 +1,6 @@
<div class="iframely-link">
<div>
- <a href="{url}" target="_blank" rel="nofollow noreferrer noopener">
+ <a href="{url}" target="_blank" rel="nofollow noreferrer noopener" data-date="{date}">
<!-- IF icon -->
<img src="{icon}" class="thumb pull-left not-responsive" />
diff --git a/public/templates/partials/iframely-widget-card.tpl b/public/templates/partials/iframely-widget-card.tpl
index b135b72..a065a32 100644
--- a/public/templates/partials/iframely-widget-card.tpl
+++ b/public/templates/partials/iframely-widget-card.tpl
@@ -10,7 +10,7 @@
<!-- IF title -->
<h4 class="media-heading">
- <a href="{url}" target="_blank" rel="nofollow noreferrer noopener" class="one-line">
+ <a href="{url}" target="_blank" rel="nofollow noreferrer noopener" class="one-line" data-date="{date}">
<!-- IF favicon -->
<img src="{favicon}" class="thumb pull-left not-responsive" />
<!-- ENDIF favicon -->