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) {
// if it's already wrapped by link, then ignore
var $value = $(value);
if ($value.parent()[0].nodeName === 'A') return;
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) {
$value[0].onload = function (e) {
if(viewAjaxCallback) viewAjaxCallback();
};
a.html(clone);
$value.replaceWith(a);
});
//blockquote
var blockquote = view.find("blockquote.raw").removeClass("raw");