mirror of
https://github.com/showdownjs/showdown.git
synced 2024-03-22 13:30:55 +08:00
Fixed Travis CI errors showdownjs/showdown#163
This commit is contained in:
parent
2863fa6a1d
commit
db60389c39
|
@ -42,13 +42,14 @@ showdown.subParser('images', function (text, options, globals) {
|
|||
|
||||
altText = altText.replace(/"/g, '"');
|
||||
url = showdown.helper.escapeCharacters(url, '*_', false);
|
||||
var isPDF = url.indexOf('.pdf') === url.length - 4;
|
||||
var result = '';
|
||||
if(isPDF){
|
||||
var isPDF = url.indexOf('.pdf') === url.length - 4,
|
||||
result = '';
|
||||
|
||||
if (isPDF)
|
||||
result = '<object data="' + url + '" type="application/pdf"';
|
||||
} else {
|
||||
else
|
||||
result = '<img src="' + url + '" alt="' + altText + '"';
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (title) {
|
||||
|
@ -65,11 +66,10 @@ showdown.subParser('images', function (text, options, globals) {
|
|||
result += ' height="' + height + '"';
|
||||
}
|
||||
|
||||
if(isPDF) {
|
||||
if (isPDF)
|
||||
result += '>' + altText + '</object>';
|
||||
} else {
|
||||
else
|
||||
result += ' />';
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user