Closed toonn closed 6 years ago
Let's not worry about performance - it only gets called with --local
so it really shouldn't be munging huge files.
I tested your code, and made a few changes to get it working, some of which were Windows only (there's a bug in the Haddock file://
links) and other issues as well. With all that, it seems to work nicely.
When serving with
--local
, replacefile://
URLs in files that are served from disk with relativefile/
URLs.Fix #236
Haven't been able to test this because of problems with zlib.h not being found even though there's multiple on my system (arch linux).
Decided to open the PR already anyway for feedback. I'm not sure about the performance implications of readFile and the literal string replacement I"m doing currently, a more proper way would be to parse URLs from the file and replace them with
showURL True
applied to them.