Remove auto linkify image since it might print out unwanted url and it can be achieved by reference syntax, issue #214

This commit is contained in:
Wu Cheng-Han 2016-10-17 18:03:26 +08:00
parent fe912f73ec
commit 70a52e2eae

View file

@ -352,19 +352,9 @@ function finishView(view) {
images.each(function (key, value) { images.each(function (key, value) {
// if it's already wrapped by link, then ignore // if it's already wrapped by link, then ignore
var $value = $(value); var $value = $(value);
if ($value.parent()[0].nodeName === 'A') return; $value[0].onload = function (e) {
var src = $(value).attr('src');
var a = $('<a>');
if (src) {
a.attr('href', src);
a.attr('target', "_blank");
}
var clone = $value.clone();
clone[0].onload = function (e) {
if(viewAjaxCallback) viewAjaxCallback(); if(viewAjaxCallback) viewAjaxCallback();
}; };
a.html(clone);
$value.replaceWith(a);
}); });
//blockquote //blockquote
var blockquote = view.find("blockquote.raw").removeClass("raw"); var blockquote = view.find("blockquote.raw").removeClass("raw");