You've already forked imgproxy
mirror of
https://github.com/imgproxy/imgproxy.git
synced 2025-11-27 22:48:53 +02:00
20 lines
507 B
JavaScript
20 lines
507 B
JavaScript
; (function (win) {
|
|
win.ProBadgePlugin = {}
|
|
|
|
function create() {
|
|
var regex = /\!\[pro\]\((\S+)\)/g;
|
|
var proLink = '<a class="badge" href="https://imgproxy.net/#pro" target="_blank">' +
|
|
'<img src="$1" title="This feature is available in imgproxy Pro"/>' +
|
|
'</a>';
|
|
|
|
return function (hook) {
|
|
hook.beforeEach(function (content, next) {
|
|
content = content.replaceAll(regex, proLink)
|
|
next(content)
|
|
})
|
|
}
|
|
}
|
|
|
|
win.ProBadgePlugin.create = create
|
|
})(window)
|