Add fallback for malformed code source urls (1.0.x)

Backport of #55