Skip to content

Commit 4f47528

Browse files
committed
Allow to pass cloudinary URLs in <meta /> content tags.
1 parent 336640a commit 4f47528

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

β€Žjs/angular.cloudinary.jsβ€Ž

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
};
2121

2222

23-
['Src', 'Srcset', 'Href'].forEach(function(attrName) {
23+
['Src', 'Srcset', 'Href', 'Content'].forEach(function(attrName) {
2424
var normalized = 'cl' + attrName;
2525
attrName = attrName.toLowerCase();
2626
angularModule.directive(normalized, ['$sniffer', function($sniffer) {
@@ -38,7 +38,7 @@
3838
}
3939

4040
attr.$observe(normalized, function(value) {
41-
if (!value)
41+
if (!value || !value.toString().match('/(ftp|http|https):\/\/(\w+:{0,1}\w*@)?(\S+)(:[0-9]+)?(\/|\/([\w#!:.?+=&%@!\-\/]))?/'))
4242
return;
4343

4444
var attributes = {};

β€Žsamples/photo_album/app/index.htmlβ€Ž

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@
77
<link rel="shortcut icon"
88
cl-href="http://cloudinary.com/favicon.png" type="fetch" effect="sepia"/>
99

10+
<!-- Facebook Share Image Meta -->
11+
<meta property="og:image" cl-content="http://cloudinary.com/images/logo.png" type="fetch"/>
12+
1013
<link rel="stylesheet" href="css/app.css">
1114
<link rel="stylesheet" href="css/animations.css">
1215

0 commit comments

Comments
 (0)