-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
htmlpreview rewrites links that use htmlpreview #48
Comments
i've the same problem! for exemple with the page: https://htmlpreview.github.io/?https://raw.githubusercontent.com/FastCGI-Archives/fcgi2/master/doc/fastcgi-prog-guide/ap_guide.htm they rewrite all the anchor as local page anchor (of ap_guide.htm) event if is relative href to the same git repository (for exemple ch1intro.htm)... i think the problem are her: htmlpreview.github.com/htmlpreview.js Line 24 in 787b673
they not support relative link (local to the git repository) with anchor, because they rewrite it systematicly with the base page name. is because if detect if (href.indexOf('#') > 0) { //Check if it's an anchor
a[i].href = '//' + location.hostname + location.pathname + location.search + '#' + a[i].hash.substring(1); //Then rewrite URL with support for empty anchor they need to check if is relative url before rewrite anchor like this... like that : var pat = /^(?:[a-z+]+:)?(\/\/|\/)/i;
if (href.indexOf('#') > 0&&pat.text(href)) { //Check if it's an anchor and absolute url this are absolute:
this are relative.
|
Same here all links with fragment part ( |
The following html preview:
http://htmlpreview.github.io/?https://github.com/epics-modules/softGlueZynq/blob/master/documentation/softGlueZynqDoc.html
contains a link (in the first paragraph, the word "autosave") that reads, in softGlueZynqDoc.html, as follows:
https://htmlpreview.github.io/?https://github.com/epics-modules/autosave/blob/R5-7-1/documentation/autoSaveRestore.html#configMenu
but if you click on it you get this:
https://htmlpreview.github.io/?https://github.com/epics-modules/softGlueZynq/blob/master/documentation/softGlueZynqDoc.html#configMenu
The text was updated successfully, but these errors were encountered: