(href)
| 1021 | } |
| 1022 | |
| 1023 | function resolveRelativeMarkdownPath(href) { |
| 1024 | var base = getCurrentRoute(); |
| 1025 | |
| 1026 | if (!base || base === 'README') { |
| 1027 | base = ''; |
| 1028 | } else if (/\/README$/.test(base)) { |
| 1029 | base = base.replace(/README$/, ''); |
| 1030 | } else { |
| 1031 | base = base.replace(/[^/]+$/, ''); |
| 1032 | } |
| 1033 | |
| 1034 | var rootPath = getSiteRootPath(); |
| 1035 | var url = new URL(href, window.location.origin + rootPath + base); |
| 1036 | var path = url.pathname; |
| 1037 | |
| 1038 | if (path.indexOf(rootPath) === 0) { |
| 1039 | path = path.slice(rootPath.length); |
| 1040 | } |
| 1041 | |
| 1042 | return path.replace(/^\/+/, ''); |
| 1043 | } |
| 1044 | |
| 1045 | function resolveImageSource(src, markdownPath) { |
| 1046 | var trimmed = (src || '').trim(); |
no test coverage detected