Skip to content

Commit a2f6ff8

Browse files
committed
Rewrite only links to HTML files
Fixes #25
1 parent 84c98f8 commit a2f6ff8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

htmlpreview.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ var HTMLPreview = {
2727
if(href.indexOf('#') > 0) { //Check if it's an anchor
2828
a[i].href = 'http://' + location.hostname + location.pathname + location.search + '#' + a[i].hash.substring(1); //Then rewrite URL with support for empty anchor
2929
}
30-
else if(href.indexOf('//raw.githubusercontent.com') > 0 || href.indexOf('//bitbucket.org') > 0) { //Check if it's from raw.github.com or bitbucket.org
30+
else if((href.indexOf('//raw.githubusercontent.com') > 0 || href.indexOf('//bitbucket.org') > 0) && (href.indexOf('.html') > 0 || href.indexOf('.htm') > 0)) { //Check if it's from raw.github.com or bitbucket.org and to HTML files
3131
a[i].href = 'http://' + location.hostname + location.pathname + '?' + href; //Then rewrite URL so it can be loaded using YQL
3232
}
3333
}

0 commit comments

Comments
 (0)