(markdown, markdownPath)
| 926 | } |
| 927 | |
| 928 | function extractFirstImage(markdown, markdownPath) { |
| 929 | var imagePattern = /!\[[^\]]*]\(([^)\s]+)(?:\s+["'][^"']*["'])?\)|<img[^>]+src=["']([^"']+)["'][^>]*>/ig; |
| 930 | var imageMatch = imagePattern.exec(markdown); |
| 931 | var src = imageMatch && (imageMatch[1] || imageMatch[2]); |
| 932 | |
| 933 | if (src) { |
| 934 | return resolveImageSource(src, markdownPath); |
| 935 | } |
| 936 | |
| 937 | return ''; |
| 938 | } |
| 939 | |
| 940 | function getCurrentRoute() { |
| 941 | return (window.location.hash || '#/').replace(/^#\/?/, '').split('?')[0]; |
no test coverage detected